ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.06k stars 1k forks source link

Unable to install APK produced by Capacitor #6714

Closed Fanman03 closed 1 year ago

Fanman03 commented 1 year ago

Bug Report

Capacitor Version

Latest Dependencies:

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

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/cli: 5.1.1
  @capacitor/android: 5.1.1
  @capacitor/core: 5.1.1

Platform(s)

Android

Current Behavior

When attempting to install an apk produced by Capacitor via adb, I am recieving the following error: adb: failed to install app-release-signed.apk: Failure [-124: Failed parse during installPackageLI: Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary]

The apk file was built by selecting Project -> Prepare Release in the Visual Studio Code extension.

Expected Behavior

The application should install, as it does on the Android Studio emulator.

Code Reproduction

Here is my capacitor.config.json file for reference:

  "appId": "com.fanman03.camviewerplusclient",
  "appName": "CamViewerPlus Client",
  "bundledWebRuntime": false,
  "webDir": "dist",
  "plugins": {
    "SplashScreen": {
      "launchShowDuration": 0
    }
  },
  "server": {
    "androidScheme": "https"
  }
}

npm --version output: 8.19.2 node --version output: v18.16.0 pod --version output (iOS issues only):

jcesarmobile commented 1 year ago

If you are building from the vs code extension, it looks like a problem with the vs code extension, not with Capacitor, you should report it there.

It's probably using jarsigner instead of apksigner https://github.com/ionic-team/capacitor/issues/6284

1e4 commented 1 year ago

@Fanman03 Did you get this solved? I'm coming across the same issue even when using cli

ionitron-bot[bot] commented 1 year ago

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.