You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/05/18 04:12:15 UTC
[GitHub] [cordova-android] Tumke opened a new issue, #1432: Crash app after update to cordova android 10.1.0
Tumke opened a new issue, #1432:
URL: https://github.com/apache/cordova-android/issues/1432
# 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{}: java.lang.RuntimeException: Failed to create webview.
### 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
<!-- Include all relevant information that might help understand and reproduce the problem -->
I can build the app without a problem, but after starting the app, the will app crash
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
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
<!-- In what environment, on what platform or on which device are you experiencing the issue? -->
Android 9 >
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
cordova cli 11.0.0
build tools 30.0.3
min sdk 26
target sdk 30
I deinstalled all cordova plugins
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [ x] I searched for existing GitHub issues
- [ x] I updated all Cordova tooling to most recent version
- [ ] I included all the necessary information above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] stefano24 commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by GitBox <gi...@apache.org>.
stefano24 commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1182880058
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.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4035)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4201)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
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:2438)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] Tumke commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by GitBox <gi...@apache.org>.
Tumke commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1219460536
Yes, we are using Proguard. I completely disabled it, but the issue stays. I'm using a Samsung s20 with android 11.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] Tumke commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by GitBox <gi...@apache.org>.
Tumke commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1220838485
It looks like that running a cordova app on 10.0.0 < without `<content src="inderx.html" />` was no problem, but now it is.
here is my complete error log:
2022-08-19 17:50:37.543 31994-31994/<appId> E/AndroidRuntime: FATAL EXCEPTION: main
Process: <appId>, PID: 31994
java.lang.RuntimeException: Unable to start activity ComponentInfo{<appId>/<appId>.<app_name>}: java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3835)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4011)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
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:2325)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8633)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
at java.util.regex.Matcher.reset(Matcher.java:256)
at java.util.regex.Matcher.<init>(Matcher.java:167)
at java.util.regex.Pattern.matcher(Pattern.java:1027)
at org.apache.cordova.ConfigXmlParser.setStartUrl(ConfigXmlParser.java:173)
at org.apache.cordova.ConfigXmlParser.getLaunchUrl(ConfigXmlParser.java:53)
at org.apache.cordova.CordovaActivity.loadConfig(CordovaActivity.java:169)
at org.apache.cordova.CordovaActivity.onCreate(CordovaActivity.java:107)
at <appId>.<app_name>.onCreate(<app_name>_Plugins.java:30)
at android.app.Activity.performCreate(Activity.java:8207)
at android.app.Activity.performCreate(Activity.java:8191)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3808)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4011)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
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:2325)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8633)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
after checking "org.apache.cordova.ConfigXmlParser.getLaunchUrl(ConfigXmlParser.java:53)" on google i found this.
https://stackoverflow.com/questions/39931346/runtime-exception-when-running-cordova-app
Then i discoverd there was no `<content src="index.html" />` our app.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] breautek commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1220673222
> Hi, i solved the issue. `<content src="index.html"/>` was missing in the config.xml.
>
> 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 `<content src>` being specified, then I'd like to see some error feedback in the cordova tooling to make this obvious during build time, or at least make it at least default to `index.html`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] breautek commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1476205280
The proper solution is to ensure that your `config.xml` is to have a `<content src="..." />` tag, as Cordova will expect that tag to exists, however starting with https://github.com/apache/cordova-android/pull/1573 Cordova will default to `index.html` for the content src if the tag is missing, instead of it crashing on a null pointer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] jonduttweiler commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by GitBox <gi...@apache.org>.
jonduttweiler commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1130634837
Hey @Tumke, if you're running your app in a device connected via USB, you can try with `adb logcat` to check what happens
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] breautek closed issue #1432: Crash app after update to cordova android 10.1.0
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek closed issue #1432: Crash app after update to cordova android 10.1.0
URL: https://github.com/apache/cordova-android/issues/1432
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] breautek commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1129551011
> What changed in cordova android which is causing this problem?
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 `PATH` variable contains:
- build tools 30.0.3 path. e.g: `$ANDROID_HOME/build-tools/30.0.3`
- `$ANDROID_HOME/cmdline-tools/6.0` (also make sure cmdline-tools are installed in Android SDK Tools.
Additionally, inside Android SDK Tools, I'd make sure you're up to date with the platform tools.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] breautek commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1476164583
Moving this from the `11.0.1` milestone to `12.0.0` milestone because master already has the major version bump.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] xmetalmw commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by "xmetalmw (via GitHub)" <gi...@apache.org>.
xmetalmw commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1476132297
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 <content src="index.html" /> was the fix I needed to build. I am on Cordova 11.1.0 and had Java 11 already, and just couldn't get past that. Phew, thanks again!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] breautek commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1220906872
Thanks for the stacktrace. The relevant part I think is:
```
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
at java.util.regex.Matcher.reset(Matcher.java:256)
at java.util.regex.Matcher.(Matcher.java:167)
at java.util.regex.Pattern.matcher(Pattern.java:1027)
at org.apache.cordova.ConfigXmlParser.setStartUrl(ConfigXmlParser.java:173)
at org.apache.cordova.ConfigXmlParser.getLaunchUrl(ConfigXmlParser.java:53)
at org.apache.cordova.CordovaActivity.loadConfig(CordovaActivity.java:169)
```
This should be enough for a volunteer to create a patch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] breautek commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1219570074
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](https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md) 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] Tumke commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by GitBox <gi...@apache.org>.
Tumke commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1220490516
Hi, i solved the issue. <content src="index.html" /> was missing in the config.xml.
Thanks for your feedback. We will try to update to cordova 11!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-android] breautek commented on issue #1432: Crash app after update to cordova android 10.1.0
Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1432:
URL: https://github.com/apache/cordova-android/issues/1432#issuecomment-1186070540
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.
- https://stackoverflow.com/questions/57802791/unable-to-start-activity-componentinfo-java-lang-runtimeexception-failed-to-cre
- https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/145
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org