Runtime Error. /users/jenkins/slaveroot/workspace/Enterprise ...

After building a native plugin, using the Corona Project Template and my own main.lua :

    • On the Corona simulator everything is OK
    • On the iOS simulator everything is OK
    • On an Android real device I get a strange modal dialog box :

Runtime Error. /users/jenkins/slaveroot/workspace/Enterprise/OS/ios-12.2/realease/subrepos/widgetLibrary/widget_switch.lua:39: attempt to index local ‘viewOff’ (a nil value)

This dialog box is displayed above my own app screen which has some layout errors.
 

Are you using a widget.newSwitch?

Yes I do.

Is this a problem for Android ?

Not that I’m aware of. Can you share your widget.newSwitch() code?

Rob

    vocalChkButton = widget.newSwitch
    (
            {
                    x =CHECK_BTN_SIZE/2,
                    y = QUESTION_HEIGHT/2,
                    style = “checkbox”,
                    id = “Checkbox”,
                    onPress = onVocalChkPressed,
                    width = CHECK_BTN_SIZE,
                    height = CHECK_BTN_SIZE,
            }
    )
    CheckGrp:insert(vocalChkButton)
 

One of my check buttons must be conditionaly shown.

I change its Visible Property somewhere in my code.

Also all the group containing my three checkbuttons is sometime invisible.

I will check later if this is the problem. But now I am busy working on the iOS native plugin.

Corona seems to be really an open software. Congratulation for having produce it :slight_smile:

hanjaChkButton = widget.newSwitch

(
        {
            x = CHECK_BTN_SIZE/2,
            y = QUESTION_HEIGHT * 3/4,
            style = “checkbox”,
            id = “Checkbox”,
            onPress = onHanjaChkPressed,
            width = CHECK_BTN_SIZE,
            height = CHECK_BTN_SIZE,
            label = ‘Toto’,
            defaultFile = “button1.png”,
            overFile = “button1-down.png”,
    }

)

CheckGrp:insert(hanjaChkButton)


hanjaChkButton.isVisible = HasAlternateTranscriptions
 

Are you using a widget.newSwitch?

Yes I do.

Is this a problem for Android ?

Not that I’m aware of. Can you share your widget.newSwitch() code?

Rob

    vocalChkButton = widget.newSwitch
    (
            {
                    x =CHECK_BTN_SIZE/2,
                    y = QUESTION_HEIGHT/2,
                    style = “checkbox”,
                    id = “Checkbox”,
                    onPress = onVocalChkPressed,
                    width = CHECK_BTN_SIZE,
                    height = CHECK_BTN_SIZE,
            }
    )
    CheckGrp:insert(vocalChkButton)
 

One of my check buttons must be conditionaly shown.

I change its Visible Property somewhere in my code.

Also all the group containing my three checkbuttons is sometime invisible.

I will check later if this is the problem. But now I am busy working on the iOS native plugin.

Corona seems to be really an open software. Congratulation for having produce it :slight_smile:

hanjaChkButton = widget.newSwitch

(
        {
            x = CHECK_BTN_SIZE/2,
            y = QUESTION_HEIGHT * 3/4,
            style = “checkbox”,
            id = “Checkbox”,
            onPress = onHanjaChkPressed,
            width = CHECK_BTN_SIZE,
            height = CHECK_BTN_SIZE,
            label = ‘Toto’,
            defaultFile = “button1.png”,
            overFile = “button1-down.png”,
    }

)

CheckGrp:insert(hanjaChkButton)


hanjaChkButton.isVisible = HasAlternateTranscriptions