I have extra simple app that consists of one page.
Everything works ok on Web or Android.
When I just install InAppBrowser and try to run it on Android - app opens and instantly closes (real device or emulator - no diff) - even if I’m not use that code and imports for real.
So I do next steps:
Installed capacitor/inappbrowser
build/copy/sync
up minSdkVersion to 26 (requirements)
run app
npm install @capacitor/inappbrowser
npx cap sync
That’s all, build is successful but app not opened anymore.
If I remove inappbrowser depency and make sync & run - all works fine again.
I would think you should see an error in LogCat. I don’t know if minSdkVersion = 26 would cause an issue, but Capacitor 6 has that set to minSdkVersion = 22 (source).
Yep, but minSdkVersion = 26 is an InAppBrowser requirement (source)
logcat has only one error when application starts:
Process: com.dev.minishop.app, PID: 9601
java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.StartupException: androidx.startup.StartupException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ReportFragment$ActivityInitializationListener;
at android.app.ActivityThread.installProvider(ActivityThread.java:7244)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6780)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6697)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: androidx.startup.StartupException: androidx.startup.StartupException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ReportFragment$ActivityInitializationListener;
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6780)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6697)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: androidx.startup.StartupException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ReportFragment$ActivityInitializationListener;
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6780)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6697)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ReportFragment$ActivityInitializationListener;
at androidx.lifecycle.ProcessLifecycleInitializer.create(ProcessLifecycleInitializer.kt:37)
at androidx.lifecycle.ProcessLifecycleInitializer.create(ProcessLifecycleInitializer.kt:25)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:180)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6780)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6697)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.lifecycle.ReportFragment$ActivityInitializationListener" on path: DexPathList[[zip file "/data/app/~~Kdst-5Y3SOSAak-FDbc_fw==/com.dev.minishop.app-TLEytO-oZBYPR_kf1r8j3Q==/base.apk"],nativeLibraryDirectories=[/data/app/~~Kdst-5Y3SOSAak-FDbc_fw==/com.dev.minishop.app-TLEytO-oZBYPR_kf1r8j3Q==/lib/x86, /system/lib, /system_ext/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at androidx.lifecycle.ProcessLifecycleInitializer.create(ProcessLifecycleInitializer.kt:37)
at androidx.lifecycle.ProcessLifecycleInitializer.create(ProcessLifecycleInitializer.kt:25)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:180)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7239)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6780)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6697)
at android.app.ActivityThread.access$1300(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) ```
I have the exact same issue, it’s blocking for me. Without this plugin, did you find any alternative for opening an url within the AppView scope (Cookies sharing in particular) ?
It is required to make SSO work in my usecase.