Android Question Please help~ B4XPreferencesDialog error(API 29)

Discussion in 'Android Questions' started by Ellen Wu, Nov 29, 2019.

  1. Ellen Wu

    Ellen Wu Member Licensed User

    I am getting this error when I run the same code with the emulator on API platform 29 but no problem on API platform 28. The libraries those I used are
    - B4XPreferencesDialog version 1.71
    - XUI Views version 2.17
    - xCustomListView 1.70


    *** Service (starter) Create ***
    ** Service (starter) Start **
    ** Activity (main) Create, isFirst = true **
    preferencesdialog_initialize (java line: 1170)
    java.lang.NoSuchFieldException: No field mColorStateList in class Landroid/graphics/drawable/GradientDrawable$GradientState; (declaration of 'android.graphics.drawable.GradientDrawable$GradientState' appears in /system/framework/framework.jar)
    at java.lang.Class.getDeclaredField(Native Method)
    at anywheresoftware.b4a.objects.B4XViewWrapper.getColor(B4XViewWrapper.java:388)
    at b4a.example3.customlistview._designercreateview(customlistview.java:305)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
    at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:67)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
    at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
    at anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:292)
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Might be an emulator problem as B4XView.Color works properly on real Android 10 devices.

    Is this an emulator created with B4A Sdk Manager?
     
  3. Ellen Wu

    Ellen Wu Member Licensed User

    Yes, the emulator was created with B4A tool.
    And my app doesn’t work on real Android 10 device, users told that the app crashed when first started. It only happened on Android 10.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. Ellen Wu

    Ellen Wu Member Licensed User

    Erel, the project already sent to you. Thank you for your help.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    It is related to targetSdkVersion. Don't set it to 29 for now. It should be 28.
     
  7. Ellen Wu

    Ellen Wu Member Licensed User

    Thank you a lot~
     
  8. Greg Breinholt

    Greg Breinholt New Member Licensed User

    I had the same issue. Setting to 28 removed it.
     
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