Ionic 3 displays "App not installed. The package appears to be Corrupt."

Asked

Viewed 172 times

0

I’m trying to install the apk on 2 different devices (Galaxy and LG), but both are displaying "App not installed. The package appears to be Corrupt.".

Earlier I was trying to include Google Login in the app, but was displaying the error 10. After reading several posts, I updated some packages and changed some settings. The result is that I can’t install my app anymore.

How I’m generating the apk:


Step 1:

Access C:\Program Files (x86)\Java\jdk1.8.0_131\bin (JAVA_HOME in my case), and I spin:

 keytool -genkey -v -keystore platforms\android\my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000`

Step 2:

I create a file release-signing.properties in Platforms/android

 keyAlias=alias_name
 keyPassword=password
 storeFile=my-release-key.keystore
 storePassword=password`

Step 3:

I go to the project directory and run (to generate the apk):

 cordova build android --release -- --keystore=platforms\android\my-release-key.keystore --storePassword=password --alias=alias_name --password=password`

Step 4:

I’ll be back in C:\Program Files (x86)\Java\jdk1.8.0_131\bin (JAVA_HOME), and run the command below to validate apk:

 jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore platforms\android\my-release-key.keystore platforms\android\app\build\outputs\apk\release\app-release.apk alias_name`

Step 5:

I copy the apk to Samsung S8+ and LG Stylus 2, I try to install, but both display "App not installed. The package appears to be Corrupt."

What I’ve already tried:


  • I set the system environment variables
  • I updated the versions of Android Studio, Android SDK Tools, Cordova, NPM and Node.js
  • I updated the plugin cordova-plugin-ionic-webview
  • I downgrade the build.gradle for 2.3.3 (and wrapper for 3.3), but an error occurred during the build, so I went back to the original
  • I changed the files config.xml andpackage.json, so that they do not contain or ~ in the spec of android and cordova-android

Ionic info:

 Ionic:

    ionic (Ionic CLI)  : 4.10.2
    Ionic Framework    : ionic-angular 3.9.2
    @ionic/app-scripts : 3.2.2

 Cordova:

    cordova (Cordova CLI) : 8.1.2 ([email protected])
    Cordova Platforms     : android 7.0.0, ios 4.5.5
    Cordova Plugins       : cordova-plugin-device 2.0.2, cordova-plugin-googleplus 7.0.0, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.0, cordova-plugin-splashscreen 5.0.2, cordova-plugin-statusbar 2.4.2, cordova-plugin-whitelist 1.3.3

 System:

    Android SDK Tools : 26.1.1
    NodeJS            : v8.4.0
    npm               : 6.8.0
    OS                : Windows 10

Other information:

  • Android Studio 3.3.1

  • ANDROID_HOME=C: Users xxxxx Appdata Local Android sdk

  • JAVA_HOME=C: Program Files java jdk1.8.0_131

  • Platforms android app build.Gradle:

    dependencies {
       classpath 'com.android.tools.build:gradle:3.0.0'
    }
    
  • Platforms android Gradle wrapper Gradle-wrapper.properties:

    distributionUrl = https\://services.gradle.org/distributions/gradle-4.1-all.zip
    

Emulator

I also tried to run the emulator, ionic cordova run android -l -c, but also displayed the following error:

Runtime Error
Unexpected Identifier
Stack
SyntaxError: Unexpected Identifier

Thus, the result is the same, and so far I do not know if my first problem (error 10 on Google login) would be solved...

EDITION 1

I tried to downgrade Cordova to version 7.0.0 and 6.5.0, and [email protected], but the problem persisted.

  • You are generating for production? cordova build android may be amended by ionic cordova build platform --aot --release --minifyjs --minifycss --optimizejs


  • @Péttrinmiranda thanks for the tip, but the error still persists. I am generating for direct installation on the device, not yet for publication in the Play Store (I think that was your question...).

  • https://www.youtube.com/watch?v=dVV_5LmEg80 , Voce has probably seen this, right?!

  • If I’m not mistaken, what this app does is change the android:installLocation from Androidmanifest.xml to "internalOnly". Neither by the app nor manually worked in my case.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.