1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question Google Play Developer Console Pre Launch Debug

Discussion in 'Android Questions' started by echapeta, Jun 22, 2016.

  1. echapeta

    echapeta Member Licensed User

    When I upload an App to the GPDC in Beta Mode, the Pre Launch Report shows a problem in only one device among 12 used to testing, the Galaxy Note 3 using
    Android 4.4, and the problem seems to be loading the layout file:

    FATAL EXCEPTION: main
    Process: com.Wardian, PID: 12331
    java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Label).
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at com.Wardian.main._activity_create(main.java:400)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
    at com.Wardian.main.afterFirstLayout(main.java:102)
    at com.Wardian.main.access$000(main.java:17)
    at com.Wardian.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:157)
    at android.app.ActivityThread.main(ActivityThread.java:5335)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.RuntimeException: Object should first be initialized (Label).
    at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
    at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:71)
    at anywheresoftware.b4a.objects.LabelWrapper.innerInitialize(LabelWrapper.java:27)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:406)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:425)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:425)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:144)
    ... 17 more

    The App runs very well in Debug and Release mode and with the other devices used by GPDC for testing.

    Attached the Layout .bal file.

    Can you help me ?

    Thank You.
     

    Attached Files:

  2. An Schi

    An Schi Well-Known Member Licensed User

    Until you find someone to help you, you could create this device in Genymotion and test it :cool:
     
  3. echapeta

    echapeta Member Licensed User

    I will try, thank you.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Is there any large image in this layout?
     
  5. echapeta

    echapeta Member Licensed User

    Hello Erel,

    The biggest (in file size) has 417kb:

    upload_2016-6-23_8-11-6.png

    Is too big ?

    Thank You!
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    The file size is not relevant. Only the image size (width * height).
     
  7. echapeta

    echapeta Member Licensed User

    Erel,

    The biggest has 400x703

    Is too big ?

    Thank You
     
  8. Erel

    Erel Administrator Staff Member Licensed User

  9. echapeta

    echapeta Member Licensed User

    Erel,

    it says 4.4, can we use the LogCat to get a clue ?:

    upload_2016-6-23_10-23-46.png
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    Worth a try.
     
  11. echapeta

    echapeta Member Licensed User

    Could you please tell me how to check in the LogCat ?
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    Can you upload it?
     
  13. echapeta

    echapeta Member Licensed User

    Yes, it's attached to this comment, I had to zip it because the size.

    By the way, the app doesn't fire error in other 4.4 cases:

    upload_2016-6-23_11-14-32.png
     

    Attached Files:

  14. Erel

    Erel Administrator Staff Member Licensed User

    This is the relevant error:
    Code:
    06-23 04:24:22.985: E/B4A(11260): Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2
    06-23 04:24:22.985: E/B4A(11260):    at android.content.res.TypedArray.getColor(TypedArray.java:327)
    06-23 04:24:22.985: E/B4A(11260):    at android.widget.TextView.<init>(TextView.java:945)
    06-23 04:24:22.985: E/B4A(11260):    at android.widget.TextView.<init>(TextView.java:863)
    06-23 04:24:22.985: E/B4A(11260):    at android.widget.TextView.<init>(TextView.java:859)
    Can you post the code from the manifest editor?
     
  15. ilan

    ilan Expert Licensed User

    could it be maybe related to b4a 6?

    maybe try to build the app via b4a < 6 and see if that crash happens.

    (i will try to make a test on genymotion) :)
     
  16. echapeta

    echapeta Member Licensed User

    This is the Manifest:

    This code will be applied to the manifest file during compilation.
    'You do not need to modify it in most cases.
    'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
    AddManifestText(
    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14"/>
    <supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
    SetApplicationAttribute(android:icon, "@drawable/icon")
    SetApplicationAttribute(android:label, "$LABEL$")
    SetApplicationAttribute(android:theme, "@android:style/Theme.Material")
    'SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.Light")
    'End of default text.


    'This code will be applied to the manifest file during compilation.
    'You do not need to modify it in most cases.
    'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
    AddManifestText(
    <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19"/>
    <supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
    SetApplicationAttribute(android:icon, "@drawable/icon")
    SetApplicationAttribute(android:label, "$LABEL$")
    ' added
    SetApplicationAttribute(android:theme, "@android:style/Theme.Material")

    'End of default text.


    ' B4A 6, google play services 30
    '************ Google Play Services Base ************
    AddApplicationText(
    <activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
    android:theme="@android:style/Theme.Translucent.NoTitleBar"
    android:exported="false"/>
    <meta-data
    android:name="com.google.android.gms.version"
    android:value="@Integer/google_play_services_version" />
    )
    '************ Google Play Services Base (end) ************



    ' you must add one of these two permissions
    ' the permission you add will define the accuracy of location updates
    AddPermission(android.permission.ACCESS_FINE_LOCATION)
    AddPermission(android.permission.INSTALL_PACKAGES)
    AddPermission(android.permission.DELETE_PACKAGES)

    AddPermission(com.android.vending.INSTALL_REFERRER)
    AddReceiverText(Starter,
    <intent-filter>
    <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>)

    AddApplicationText(
    <meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="AIzaSyAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
    )

    AddPermission(android.permission.ACCESS_NETWORK_STATE)
     
  17. ilan

    ilan Expert Licensed User

    this is how my manifest editor look like (if that helps)

    Code:
    'This code will be applied to the manifest file during compilation.
    'You do not need to modify it in most cases.
    'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
    AddManifestText(
    <uses-sdk android:minSdkVersion=
    "11" android:targetSdkVersion="19"/>
    <supports-screens android:largeScreens=
    "true"
        android:normalScreens=
    "true"
        android:smallScreens=
    "true"
        android:anyDensity=
    "true"/>)
    SetApplicationAttribute(android:icon, 
    "@drawable/icon")
    SetApplicationAttribute(android:
    label"$LABEL$")
    'End of default text.
    SetActivityAttribute(Main, android:hardwareAccelerated, "true")
    SetApplicationAttribute(android:theme, 
    "@android:style/Theme.Material")

    'AdMob
    AddApplicationText(
    <meta-data android:name=
    "com.google.android.gms.version"
      android:value=
    "@integer/google_play_services_version"/>
    <
    activity android:name="com.google.android.gms.ads.AdActivity"
      android:configChanges=
    "keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

    )
    'End of AdMob
     
  18. ilan

    ilan Expert Licensed User

    i think this is the trouble maker:

    Code:
    SetApplicationAttribute(android:theme, "@android:style/Theme.Material")
    EDIT: genymotion does not have 4.4 device :(
     
  19. echapeta

    echapeta Member Licensed User

    I tried commenting that manifest line to the same error....

    I found this device in Genymotion:

    upload_2016-6-23_11-41-57.png

    In this emulated device the app doesn't raise any error....
     
  20. ilan

    ilan Expert Licensed User

    We need a 4.4 device. 4.4.4 may work.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice