distriqt / ANE-AndroidSupport

Android Support Library Native Extension
https://airnativeextensions.com
22 stars 4 forks source link

Crash and not start after update uo last release of Androix.core #21

Closed lwmirkk closed 2 years ago

lwmirkk commented 2 years ago

Hi!

Before was : Application-6.8.4 and Androix.core-1.6.0 and was working. After update these two, My app crash before start, this is the logcat:


03-15 19:30:19.318  3763  3763 D MiTv-Service-TvService-Parent: current foreground packagename is my.app.id
03-15 19:30:19.322  2991  5895 E MesonHwc: mi version
03-15 19:30:19.350 26860 26860 I MultiDex: VM with version 2.1.0 has multidex support
03-15 19:30:19.350 26860 26860 I MultiDex: Installing application
03-15 19:30:19.350 26860 26860 I MultiDex: VM has multidex support, MultiDex support library is disabled.
03-15 19:30:19.368 26860 26860 D AndroidRuntime: Shutting down VM
03-15 19:30:19.370 26860 26860 E AndroidRuntime: FATAL EXCEPTION: main
03-15 19:30:19.370 26860 26860 E AndroidRuntime: Process: my.app.id, PID: 26860
03-15 19:30:19.370 26860 26860 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider androidx.lifecycle.ProcessLifecycleOwnerInitializer: java.lang.ClassNotFoundException: Didn't find class "androidx.lifecycle.ProcessLifecycleOwnerInitializer" on path: DexPathList[[zip file "/data/app/my.app.id--JxU9ENUPnAZtfzLU-O-RA==/base.apk"],nativeLibraryDirectories=[/data/app/my.app.id--JxU9ENUPnAZtfzLU-O-RA==/lib/arm, /data/app/my.app.id--JxU9ENUPnAZtfzLU-O-RA==/base.apk!/lib/armeabi-v7a, /system/lib, /product/lib]]
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at android.app.ActivityThread.installProvider(ActivityThread.java:6407)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at android.app.ActivityThread.installContentProviders(ActivityThread.java:5949)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5864)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at android.app.ActivityThread.access$1100(ActivityThread.java:200)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1651)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:193)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6680)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
03-15 19:30:19.370 26860 26860 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.lifecycle.ProcessLifecycleOwnerInitializer" on path: DexPathList[[zip file "/data/app/my.app.id--JxU9ENUPnAZtfzLU-O-RA==/base.apk"],nativeLibraryDirectories=[/data/app/my.app.id--JxU9ENUPnAZtfzLU-O-RA==/lib/arm, /data/app/my.app.id--JxU9ENUPnAZtfzLU-O-RA==/base.apk!/lib/armeabi-v7a, /system/lib, /product/lib]]
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at android.app.AppComponentFactory.instantiateProvider(AppComponentFactory.java:121)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    at android.app.ActivityThread.installProvider(ActivityThread.java:6391)
03-15 19:30:19.370 26860 26860 E AndroidRuntime:    ... 10 more
03-15 19:30:19.383  3199  5154 W ActivityManager:   Force finishing activity my.app.id/.AIRAppEntry
lwmirkk commented 2 years ago

Sorry, discovered the problem, the manifest additions was changes, if anyone have this problem, before:

<provider
        android:name="androidx.lifecycle.ProcessLifecycleOwnerInitializer"
        android:authorities="APPLICATION_PACKAGE.lifecycle-process"
        android:exported="false"
        android:multiprocess="true" />

After Application ANE - 6.8.5:

       <provider
            android:name="androidx.startup.InitializationProvider"
            android:authorities="APPLICATION_PACKAGE.androidx-startup"
            android:exported="false" >
            <meta-data
                android:name="androidx.lifecycle.ProcessLifecycleInitializer"
                android:value="androidx.startup" />
        </provider>
marchbold commented 2 years ago

Yes correct, we missed an update to the lifecycle libs in the 1.6.0 update which was causing issues with other extensions and required this update.

Highly recommend using apm to avoid issues like this in the future.

leossmith commented 2 years ago

Hey @marchbold I am using apm (1.1.5) and after updated my anes and regenerated descriptor, my app crash on startup. Logs say: Didn't find class "androidx.lifecycle.ProcessLifecycleOwnerInitializer" .

image

marchbold commented 2 years ago

@leossmith Hmm that's odd, can you try clearing the cache and reinstalling (i.e. delete apm_packages and run apm install, then regenerate the app descriptor apm generate app-descriptor ... ).

leossmith commented 2 years ago

@marchbold the apm_packages delete and apm install fixed it for me. Thank you.