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
Crash app after update to cordova android 10.1.0 #1432
Comments
The most significant change is cordova-android@10 now uses AndroidX. But incompatibilties with AndroidX tends to manifest into build errors, not runtime errors. I'd make sure that your
Additionally, inside Android SDK Tools, I'd make sure you're up to date with the platform tools. If none of these help, we will need to see a stacktrace to provide any other insights, or better... you will need to try to develop a minimal reproduction app. |
Hey @Tumke, if you're running your app in a device connected via USB, you can try with |
Hi, I've the same issue and crash with cordova-android ^10.1.2 minSdkVersion 25, target sdk 30. found with Firebase Crashlytics. it's a Samsung smartphone Galaxy S10 with android 12. I can't replicate the problem yet on my phone. Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.app/com.my.app.MainActivity}: java.lang.RuntimeException: Failed to create webview. |
Using proguard will cause issues like this. If you're using Proguard, you'll need to disable it or add exception rules (cordova has many APIs that are invoked by strings, used by plugins, therefore they cannot be obfuscated. Some references:
Please confirm if you are using proguard and if so, if disabling it solves your issue. Due to the nature of plugin API calls, using proguard isn't really a supported configuration. |
Yes, we are using Proguard. I completely disabled it, but the issue stays. I'm using a Samsung s20 with android 11. I reproduced the error, and i see that it is different than when i started this issue (with and without proguard). I update the first post with the wright error message in logcat. java.lang.RuntimeException: Unable to start activity ComponentInfo{/apId}: java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference |
Thanks for confirming. At this point, we have cordova-android@11 is released and cordova-android@10 is no longer supported. So I'd ask you kindly if you can confirm the issue still presents itself when using cordova-android@11. cordova-android@11 will require build tools version 32 and java 11. The most significant changes within the cordova code base is the introduction of the android splashscreens, honestly I'm not confident it will fix your issue, but we generally do not make backports. Should your issue still persists, we will likely require a minimal reproduction app so that we can further investigate what is going on by tracing the error. A minimal reproduction app can be created by starting with a brand new test project, and slowly adding in plugins and bits of code until the issue reliably reproduces. This will help isolate the issue as well serve as a test case. |
Hi, i solved the issue. Thanks for your feedback. We will try to update to cordova 11! |
Well that is certainly is interesting and if it fatally crashes during runtime due to the lack of the |
It looks like that running a cordova app on 10.0.0 < without here is my complete error log: 2022-08-19 17:50:37.543 31994-31994/ E/AndroidRuntime: FATAL EXCEPTION: main after checking "org.apache.cordova.ConfigXmlParser.getLaunchUrl(ConfigXmlParser.java:53)" on google i found this. Then i discoverd there was no |
Thanks for the stacktrace. The relevant part I think is:
This should be enough for a volunteer to create a patch. |
Goodness, thank you for this thread. I've been bashing against that vague error for a few days after upgrading Cordova and trying to rebuild an older app. While I thought my config was fine, adding the |
Moving this from the |
The proper solution is to ensure that your |
Bug Report
App crash after update from cordova android 10.0.0 to 10.1.0 >
Problem
java.lang.RuntimeException: Unable to start activity ComponentInfo{/apId}: java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
What is expected to happen?
A starting app
What does actually happen?
The app crashes with java.lang.RuntimeException: Unable to start activity ComponentInfo{}: java.lang.RuntimeException: Failed to create webview.
Information
I can build the app without a problem, but after starting the app, the will app crash
Command or Code
Difficult to say, it is something in our app i guess. When i test it with a cordova testapp there is no problem. What changed in cordova android which is causing this problem?
Environment, Platform, Device
Android 9 >
Version information
cordova cli 11.0.0
build tools 30.0.3
min sdk 26
target sdk 30
I deinstalled all cordova plugins
Checklist
The text was updated successfully, but these errors were encountered: