-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cordova-android@11 layout/splash_screen_view #1497
Comments
I too am seeing crashes in the Google Play console related to InflateException, SynchronizedLazyImpl.getValue. All errors are pointing to android.view.InflateException at LayoutInflater.java:539. Looking further into the stack traces they seem splashscreen related. Devices suffering from this are running Android 6.0 |
By Android API S, I assume you mean API 31/Android 12.0 simulator. I tried this with an empty cordova project with the default settings, as shown in the reproduction steps. and it isn't producing any RuntimeException for me. I recommend to do the following:
If all that looks correct and you still have a reproducible error, then we may need a minimal reproduction app to move this issue along. |
On my case, I was overriding the app's theme
Obviously the initial theme now needs to be a splash theme, which was causing my issues. To solve the issue, I removed above lines and replaced it with
|
That was it, thanks! |
closing since the reporter never answered and some other users found out their problem |
Solve it : #1559 (comment) |
For anyone else using vanilla Cordova, the solution is to se the proper theme for AndroidManifest.xml in your config.xml as follows: <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<activity android:theme="@style/Theme.App.SplashScreen"></activity>
</edit-config> This requires the XML namespace |
You shouldn't need to change this for vanilla Cordova Android 12.x, because
|
Bug Report
Problem
After upgrading my project to cordova-android11 I'm getting a RuntimeException only with Android API S after opening the app, though is working fine with API 33 and API 29.
What is expected to happen?
Show splashscreen and run app normally.
What does actually happen?
I'm getting this error:
--------- beginning of crash
2022-09-21 10:08:38.566 6584-6584/io.cordova.hellocordova E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.cordova.hellocordova, PID: 6584
java.lang.RuntimeException: Unable to start activity ComponentInfo{io.cordova.hellocordova/io.cordova.hellocordova.MainActivity}: android.view.InflateException: Binary XML file line #24 in io.cordova.hellocordova:layout/splash_screen_view: Failed to resolve attribute at index 0: TypedValue{t=0x2/d=0x7f0300df a=-1}
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3765)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:102)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2193)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7796)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:974)
Caused by: android.view.InflateException: Binary XML file line #24 in io.cordova.hellocordova:layout/splash_screen_view: Failed to resolve attribute at index 0: TypedValue{t=0x2/d=0x7f0300df a=-1}
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 0: TypedValue{t=0x2/d=0x7f0300df a=-1}
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:827)
at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:8230)
at android.view.ViewGroup$MarginLayoutParams.(ViewGroup.java:8428)
at android.widget.FrameLayout$LayoutParams.(FrameLayout.java:452)
at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:380)
at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:58)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1129)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
at android.view.LayoutInflater.inflate(LayoutInflater.java:686)
at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
at android.view.LayoutInflater.inflate(LayoutInflater.java:485)
at android.view.View.inflate(View.java:27024)
at androidx.core.splashscreen.SplashScreenViewProvider$ViewImpl$_splashScreenView$2.invoke(SplashScreenViewProvider.kt:94)
at androidx.core.splashscreen.SplashScreenViewProvider$ViewImpl$_splashScreenView$2.invoke(SplashScreenViewProvider.kt:93)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at androidx.core.splashscreen.SplashScreenViewProvider$ViewImpl.get_splashScreenView(SplashScreenViewProvider.kt:93)
at androidx.core.splashscreen.SplashScreenViewProvider$ViewImpl.createSplashScreenView(SplashScreenViewProvider.kt:103)
at androidx.core.splashscreen.SplashScreenViewProvider.(SplashScreenViewProvider.kt:52)
at androidx.core.splashscreen.SplashScreen$Impl.setOnExitAnimationListener(SplashScreen.kt:305)
at androidx.core.splashscreen.SplashScreen.setOnExitAnimationListener(SplashScreen.kt:185)
at org.apache.cordova.SplashScreenPlugin.setupSplashScreen(SplashScreenPlugin.java:141)
at org.apache.cordova.SplashScreenPlugin.onMessage(SplashScreenPlugin.java:113)
at org.apache.cordova.PluginManager.lambda$postMessage$0(PluginManager.java:345)
at org.apache.cordova.PluginManager$$ExternalSyntheticLambda0.accept(Unknown Source:8)
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:724)
at java.util.Collections$SynchronizedMap.forEach(Collections.java:2698)
at org.apache.cordova.PluginManager.postMessage(PluginManager.java:343)
at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:161)
at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:234)
2022-09-21 10:08:38.566 6584-6584/io.cordova.hellocordova E/AndroidRuntime: at io.cordova.hellocordova.MainActivity.onCreate(MainActivity.java:40)
at android.app.Activity.performCreate(Activity.java:8036)
at android.app.Activity.performCreate(Activity.java:8016)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3581)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3765)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:102)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2193)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7796)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:974)
Information
This bug is resolved when I add a splash_screen_view.xml file myself in the layout folder, but after then API 29 doesn't work.
Command or Code
cordova create myApp2
cordova platform add android@11
cordova run android ( Android API S Simulator )
Environment, Platform, Device
cordova-android@11
Android API S Simulator
Checklist
The text was updated successfully, but these errors were encountered: