Skip to content

[Bug]: Application Not Launching on Android After Capacitor 7 Update #7925

@pashkevich-d

Description

@pashkevich-d

Capacitor Version

Latest Dependencies:

@capacitor/cli: 7.1.0
@capacitor/core: 7.1.0
@capacitor/android: 7.1.0
@capacitor/ios: 7.1.0

Installed Dependencies:

@capacitor/cli: 7.1.0
@capacitor/core: 7.1.0
@capacitor/android: 7.1.0
@capacitor/ios: 7.1.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Other API Details

npm 10.2.4
node v20.11.1

tsconfig
"target": "ES2022"
"lib": ["es2019", "dom"],
"module": "ESNext"

variables.gradle
    minSdkVersion = 23
    compileSdkVersion = 35
    targetSdkVersion = 35
    androidxActivityVersion = '1.9.2'
    androidxAppCompatVersion = '1.7.0'
    androidxCoordinatorLayoutVersion = '1.2.0'
    androidxCoreVersion = '1.15.0'
    androidxFragmentVersion = '1.8.4'
    junitVersion = '4.13.2'
    androidxJunitVersion = '1.2.1'
    androidxEspressoCoreVersion = '3.6.1'
    cordovaAndroidVersion = '10.1.1'
    coreSplashScreenVersion = '1.0.1'
    androidxWebkitVersion = '1.12.1'
    playServicesLocationVersion = '21.0.1'

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

After updating to Capacitor 7, some testers reported that the app no longer starts on Android 10 and 13. I was able to reproduce this issue myself. The app works fine on Android 14 and above, but on Android 13 and below, it either crashes or shows a white screen after briefly displaying the splash screen.

I initially suspected that the issue might be related to an older WebView version on these devices, but these testers have relatively new version of WebView.

Expected Behavior

The app should launch successfully without crashing or showing a white screen.

Project Reproduction

Additional Information

There are no errors in the logcat that seem helpful, except for the following:

E File: https://localhost/ - Line 789 - Msg: SyntaxError: Unexpected token '{' 2025-03-18 13:42:50.623 10890-10890 Capacitor com.my.app E JavaScript Error: {"type":"js.error","error":{"message":"Uncaught SyntaxError: Unexpected token '{'","url":"https://localhost/polyfills.756929c5c2ec8349.js","line":1,"col":12907,"errorObject":"{}"}} 2025-03-18 13:42:50.623 10890-10890 Capacitor/Console com.my.app E File: https://localhost/polyfills.756929c5c2ec8349.js - Line 1 - Msg: Uncaught SyntaxError: Unexpected token '{' 2025-03-18 13:42:50.639 10890-10890 Capacitor/Console com.my.app E File: https://localhost/ - Line 789 - Msg: SyntaxError: Unexpected token '{' 2025-03-18 13:42:50.639 10890-10890 Capacitor com.my.app E JavaScript Error: {"type":"js.error","error":{"message":"Uncaught SyntaxError: Unexpected token '{'","url":"https://localhost/main.55aceb4de5cb47d2.js","line":1,"col":5556,"errorObject":"{}"}} 2025-03-18 13:42:50.639 10890-10890 Capacitor/Console com.my.app E File: https://localhost/main.55aceb4de5cb47d2.js - Line 1 - Msg: Uncaught SyntaxError: Unexpected token '{'

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproductionneeds reproducible example to illustrate the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions