-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Bug]: Application crashes on Android after upgrading to the latest 5.7.1 version #7309
Comments
@ryaa The PR above doesn't solved my problem. The problem still persist and even after I downgrade to 5.7.0 and 5.6.0. |
If I revert to the following code, the app build works.
|
The problem that PR fixes is not related to the app build but it fixes the problem when the app is launched and immediately crashes with the error shown in the original description. |
Please make sure to sync the native project after the you install a different version of @capacitor/android. The problem, as I believe, was introduced in 5.7.1 and everything should work fine in 5.7.0 or below |
This method solved my problem. Thanks @aheadfullofcode |
The new @capacitor/android v5.7.2 has already been released with the appropriate fix. You can install and use it. |
Hello, |
No more issue with 5.7.2. |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Capacitor Version
alexryltsov@Alexs-MacBook-Pro-2 chore-781-upgrade-to-latest-capacitor-5x-and-native-dependencies-to-latest-versions % npx cap doctor
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 5.7.1
@capacitor/core: 5.7.1
@capacitor/android: 5.7.1
@capacitor/ios: 5.7.1
Installed Dependencies:
@capacitor/cli: 5.5.0
@capacitor/core: 5.7.1
@capacitor/android: 5.7.1
@capacitor/ios: 5.7.1
[success] iOS looking great! 👌
[success] Android looking great! 👌
Other API Details
Platforms Affected
Current Behavior
Application crashes on Android after upgrading to the latest 5.7.1 version
Expected Behavior
The app works as expected and does not crash
Project Reproduction
https://github.com/ryaa/capacitor-android-5.7.1-app-crash
Additional Information
The problem seems to be related with the changes in JSInjector.java file in the recent @capacitor/android release v5.7.1. The problem is that some plugins (specifically cordova-plugin-advanced-http plugin) might embeds some scripts that has some special chars that needs to be properly escaped - see below


and
If this is not done, if the replacement string, passed to replaceFirst method, contains $1 or other $-prefixed sequences, the replaceFirst method will interpret them as references to capture groups and, since there might be no such a capture group, there will be an IndexOutOfBoundsException as shown above. This PR should fix this problem
The text was updated successfully, but these errors were encountered: