Android Question Problems of my app on Android 8

desof

Well-Known Member
Licensed User
Longtime User
I have my application in PlayStore but I am receiving messages from users who have Android 8 version that can not use it.
I was investigating a bit and it seems to me that the person responsible for this is my manifest.
I attached it below to see if they give me a little light

Thank you


B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
    
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")

'********* TEMA **********************
SetApplicationAttribute(android:theme, "@style/MyAppTheme")
SetActivityAttribute(LSlider, android:screenOrientation, "landscape")

CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">#0098FF</item>
        <item name="colorPrimaryDark">#007CF5</item>
        <item name="colorAccent">#045AAE</item>
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>
)

'*************** PERMISOS ******************
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.INTERNET)
'*************** FIN PERMISOS ******************

'*************** FIN TEMA ******************

CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
'''CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)

'************ Firebase Base ************
'''CreateResourceFromFile("google-services", "google-services.json")
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(com.google.android.c2dm.permission.RECEIVE)
AddPermission(${applicationId}.permission.C2D_MESSAGE)
AddManifestText( <permission android:name="${applicationId}.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />)
AddApplicationText(
<receiver
          android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
          android:enabled="true">
        <intent-filter>
          <action android:name="com.google.android.gms.measurement.UPLOAD"/>
        </intent-filter>
      </receiver>

      <service
          android:name="com.google.android.gms.measurement.AppMeasurementService"
          android:enabled="true"
          android:exported="false"/>   
    <provider
            android:authorities="${applicationId}.firebaseinitprovider"
            android:name="com.google.firebase.provider.FirebaseInitProvider"
            android:exported="false"
            android:initOrder="100" />
      <receiver
          android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
          android:enabled="true">
        <intent-filter>
          <action android:name="com.google.android.gms.measurement.UPLOAD"/>
        </intent-filter>
      </receiver>

      <service
          android:name="com.google.android.gms.measurement.AppMeasurementService"
          android:enabled="true"
          android:exported="false"/>
    <receiver
            android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                <category android:name="${applicationId}" />
            </intent-filter>
        </receiver>
       <receiver
            android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
            android:exported="false" />

    
        <service
            android:name="com.google.firebase.iid.FirebaseInstanceIdService"
            android:exported="true">
            <intent-filter android:priority="-500">
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
)
 

Computersmith64

Well-Known Member
Licensed User
Longtime User
Can you be more specific about what "Android 8 can not use it" means? Do users get an error? Have you tried running on a simulator with Android 8.x on it? If you post a link to the app I will install it on my Android 8 device & see if it runs ok.

- Colin.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You can see for yourself in this link
onPackageStatusChange packageName = sancrisapp.dos.cero, userID = 0
[Persistence,AffiliationManager] No affiliation data for android://0Arv_dbNrbXG_v4L41wSkyk2NJqxR4HYZN0nsoUH_mOgwSL4CM9pc_vjLfUan8NBq72O62mNq5bsypnmaHziCg==@sancrisapp.dos.cero/. Marking affiliation data as stale...
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
not sure if this applies to your app. Just found it in the unfiltered log

getGamePkgData(). sancrisapp.dos.cero
sphal namespace is not configured for this process. Loading /vendor/lib64/egl/libGLES_mali.so from the current namespace instead.
adjustSystemUiVisibilityLw : vis= 0x961a
Relayout returned: old=[0,0][1440,2960] new=[0,0][1440,2960] result=0x5 surface={valid=false 0} changed=true
MSG_WINDOW_FOCUS_CHANGED 0
[ELog][2][EasySignUpDBHandler] query end
[NetworkCommon][SSF][2][EasySignUpInterface] isAuth is false
Start proc 8240:com.samsung.android.bixby.agent.emservice/5018 for broadcast com.samsung.android.bixby.agent/.receiver.ExecutorManagerPackageReceiver
isWhitelistProcess - Process is Whitelisted
KPU : put [com.samsung.android.knox.containeragent] : 10644 K
Killing 4698:com.samsung.android.knox.containeragent/u150s1250 (adj 906): DHA:empty #33
SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SM-N950F_8.0.0_0009, [-1 -1 -1 -1 0 1]
SELinux: seapp_context_lookup: seinfo=platform, level=s0:c512,c768, pkgname=com.samsung.android.bixby.agent.emservice
Class com.google.firebase.auth.FirebaseAuthRegistrar is not an found.
java.lang.ClassNotFoundException: com.google.firebase.auth.FirebaseAuthRegistrar
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at com.google.firebase.components.zzc.zza(SourceFile:63)
at com.google.firebase.components.zzc.zza(SourceFile:56)
at com.google.firebase.FirebaseApp.<init>(SourceFile:496)
at com.google.firebase.FirebaseApp.initializeApp(SourceFile:324)
at com.google.firebase.FirebaseApp.initializeApp(SourceFile:294)
at com.google.firebase.FirebaseApp.initializeApp(SourceFile:281)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(SourceFile:37)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1925)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1900)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(SourceFile:31)
at android.app.ActivityThread.installProvider(ActivityThread.java:6574)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6129)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6039)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6940)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.auth.FirebaseAuthRegistrar" on path: DexPathList[[zip file "/data/app/sancrisapp.dos.cero-MrCXkp7xwp8P9qRzk1uZjA==/base.apk"],nativeLibraryDirectories=[/data/app/sancrisapp.dos.cero-MrCXkp7xwp8P9qRzk1uZjA==/lib/arm64, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 24 more
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
I got this from the logs when I tried to run it on my Nexus 5X (Android 8.1.0):

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (principal) Create, isFirst = true **
** Activity (principal) Resume **
exito
principal$ResumableSub_Activity_Createresume (java line: 618)
java.io.FileNotFoundException: /storage/emulated/0/Android/data/sancrisapp.dos.cero/files/comercios.db (No such file or directory)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:287)
at java.io.FileOutputStream.<init>(FileOutputStream.java:223)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:448)
at anywheresoftware.b4a.objects.streams.File.Copy(File.java:341)
at sancrisapp.dos.cero.principal$ResumableSub_Activity_Create.resume(principal.java:618)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:245)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:185)
at anywheresoftware.b4a.BA$2.run(BA.java:365)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

It seems that your database either doesn't exist, or it's not where you intended it to be.

I also notice that Play Store shows the app not compatible with my tablet - I'm guessing this is because it uses telephony features & my tablet can't make phone calls. I don't know if you intended for tablet users not to be able to use the app, but if you want it to be installed on tablets, add this line to your manifest:

B4X:
AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false"></uses-feature>)

- Colin.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
When I installed it on my Galaxy S3 (Android 4.4.2) I got this:

Logger connected to: 360ceeb6
--------- beginning of /dev/log/system--------- beginning of /dev/log/main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (principal) Create, isFirst = true **
principal$ResumableSub_Activity_Createresume (java line: 731)
java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process sancrisapp.dos.cero. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(SourceFile:218)
at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(Unknown Source)
at de.donmanfred.FirebaseRemoteConfigWrapper.Initialize(FirebaseRemoteConfigWrapper.java:50)
at sancrisapp.dos.cero.principal$ResumableSub_Activity_Create.resume(principal.java:731)
at sancrisapp.dos.cero.principal._activity_create(principal.java:459)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at sancrisapp.dos.cero.principal.afterFirstLayout(principal.java:104)
at sancrisapp.dos.cero.principal.access$000(principal.java:17)
at sancrisapp.dos.cero.principal$WaitForLayout.run(principal.java:82)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5487)
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:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
principal$ResumableSub_Activity_Createresume (java line: 731)
java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process sancrisapp.dos.cero. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(SourceFile:218)
at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(Unknown Source)
at de.donmanfred.FirebaseRemoteConfigWrapper.Initialize(FirebaseRemoteConfigWrapper.java:50)
at sancrisapp.dos.cero.principal$ResumableSub_Activity_Create.resume(principal.java:731)
at sancrisapp.dos.cero.principal._activity_create(principal.java:459)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at sancrisapp.dos.cero.principal.afterFirstLayout(principal.java:104)
at sancrisapp.dos.cero.principal.access$000(principal.java:17)
at sancrisapp.dos.cero.principal$WaitForLayout.run(principal.java:82)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5487)
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:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)

- Colin.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Could you please specifically tell me what is wrong?

Thank you
Well for starters, you should probably be using the Firebase macros (assuming you're using B4A v8+):

B4X:
'************ Google Play Services Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)

'************ Firebase Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)

'************ Firebase Analytics ************
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)

As Erel said - read the Firebase tutorials on the forum & you should be fine.

- Colin.
 
Upvote 0

desof

Well-Known Member
Licensed User
Longtime User
Well for starters, you should probably be using the Firebase macros (assuming you're using B4A v8+):

B4X:
'************ Google Play Services Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)

'************ Firebase Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)

'************ Firebase Analytics ************
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)

As Erel said - read the Firebase tutorials on the forum & you should be fine.

- Colin.
yes used actuality

CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
yes used actuality

CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)

Yes - but it looks like you've duplicated the CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase) by adding your '************ Firebase Base ************ section. I don't know whether that's causing issues or not, but I don't think you need that whole section.

- Colin.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
I think you've got multiple issues there. Your Firebase configuration seems incorrect & there is also an issue with not being able to access the database. I can't run the app on any of my devices (Android 8.x, 4.x). I'm surprised it's only Android 8.x users that are saying it doesn't run.

Did the app run OK on a previous release - ie: did you start having issues after a recent update? If so, take a look at the changes you made in that update as a starting point to finding the cause of your issues.

- Colin.
 
Upvote 0

desof

Well-Known Member
Licensed User
Longtime User
I think you've got multiple issues there. Your Firebase configuration seems incorrect & there is also an issue with not being able to access the database. I can't run the app on any of my devices (Android 8.x, 4.x). I'm surprised it's only Android 8.x users that are saying it doesn't run.

Did the app run OK on a previous release - ie: did you start having issues after a recent update? If so, take a look at the changes you made in that update as a starting point to finding the cause of your issues.

- Colin.

2 years ago it is in operation and it is true that it started to have problems after we had to change forced from August 1 minSdkVersion by google directives.
Anyway it is possible that there is also an error of access to the Database
This is the first line that verifies that it exists and if it is not, the copy

B4X:
If File.ExternalWritable Then
        Funciones.ruta= File.DirDefaultExternal
    Else
        Funciones.ruta=File.DirInternal
    End If
B4X:
    If Not(File.Exists(Funciones.ruta, "comercios.db")) Then
        'Msgbox (File.DirAssets,Funciones.ruta)
        File.Copy(File.DirAssets, "comercios.db", Funciones.ruta, "comercios.db")
    End If
 
Upvote 0
Top