简体   繁体   中英

MacOS & Android Studio - generated apks (file) cannot be installed on device

I am using androidStudio (3.3) on MacOS (I just moved from windows to mac). The Apk (signed & unsigned can be generated), the unsigned packages can be installed and executed on the emulator environment.

But when I try to install it on a real device (copy on SD, allow installation from other sources), the installation fails:

Error message: app cannot be installed since package seems to be corrupt.

This issue occurs for

  • unsigned apks
  • signed apks

If I rename the extension from apk to zip (apk is acutally a zip file), I am able to open it without any issues. I never had the issue as long I was working with an Windows PC

At the final end I need a (signed) apk that can be uploaded to google play...

Any suggestions?

if you install apk(package name) on your device you see this error when you want install new apk :

app cannot be installed since package seems to be corrupt.

For fix that

1) You can uninstall app from device and reinstall from apk.

2) You can change versionCode in build.gradle(app)

  defaultConfig {
        applicationId your_package_name   
        versionCode 2 //try to increase every time
        versionName "1.0.0" //no need to change but better change it
        //other codes
  }

Remember that you can not share debug apk file from device and made this error too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM