Thursday, 21 February 2019

Ionic 3 - App not installed. The package appears to be corrupt

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

First, I was trying to include Google Login in my app, but it was displaying error 10. Following several posts, I had updated some packages and changed some settings. The result is that my app doesn't install anymore.

What I did:

Step 1:

Go to C:\Program Files (x86)\Java\jdk1.8.0_131\bin (JAVA_HOME in my case), and run:

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

Step 2:

Create release-signing.properties file in the platforms/android

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

Step 3:

Go to project directory and run:

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

Step 4:

Go back to C:\Program Files (x86)\Java\jdk1.8.0_131\bin (JAVA_HOME), and run to validate:

 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:

Copy to Samsung S8+ and LG Stylus 2, both displayed "App not installed. The package appears to be corrupt."

What I have tried:

  • Set the system environment variables
  • Update Android Studio, Android SDK Tools, Cordova, NPM and Node.js versions
  • Update cordova-plugin-ionic-webview
  • Downgrade build.gradle to 2.3.3 (and wrapper to 3.3), but happened an error during the build
  • Change config.xml and package.json, in order do not contain a ^ or a ~ in the android and cordova-android version/spec

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 (cordova-lib@8.1.1)
    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

More 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
    
    

But the result is the same, and even I don't know if my first problem (error 10 at Google sign in) is solved...

EDIT

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

Runtime Error
Unexpected Identifier
Stack
SyntaxError: Unexpected Identifier

EDIT 2

I tried to downgrade Cordova to 7.0.0 version, but the problem still remains the same.



from Ionic 3 - App not installed. The package appears to be corrupt

No comments:

Post a Comment