4

Our app, used to work. The last update published 2 and a half weeks ago when the apk file created and worked properly.

The last 2 days when we are trying to create the apk (signed or not the problem appears), no errors are thrown from Android Studio, but when the apk is going to be installed on the phone, the app is failed to install with an error "App not Installed"

Additionally the following errors are appearing in Android Monitor.

Class not found when unmarshalling: com.android.packageinstaller.InstallFlowAnalytics
                                           java.lang.ClassNotFoundException: com.android.packageinstaller.InstallFlowAnalytics
                                               at java.lang.Class.classForName(Native Method)
                                               at java.lang.Class.forName(Class.java:324)
                                               at android.os.Parcel.readParcelableCreator(Parcel.java:2404)
                                               at android.os.Parcel.readParcelable(Parcel.java:2358)
                                               at android.os.Parcel.readValue(Parcel.java:2264)
                                               at android.os.Parcel.readArrayMapInternal(Parcel.java:2614)
                                               at android.os.BaseBundle.unparcel(BaseBundle.java:221)
                                               at android.os.BaseBundle.getString(BaseBundle.java:920)
                                               at android.content.Intent.getStringExtra(Intent.java:6183)
                                               at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:2706)
                                               at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:2171)
                                               at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:6359)
                                               at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:6127)
                                               at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:170)
                                               at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3999)
                                               at android.os.Binder.execTransact(Binder.java:453)
                                            Caused by: java.lang.ClassNotFoundException: com.android.packageinstaller.InstallFlowAnalytics
                                               at java.lang.Class.classForName(Native Method)
                                               at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
                                               at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
                                               at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
                                               at java.lang.Class.classForName(Native Method) 
                                               at java.lang.Class.forName(Class.java:324) 
                                               at android.os.Parcel.readParcelableCreator(Parcel.java:2404) 
                                               at android.os.Parcel.readParcelable(Parcel.java:2358) 
                                               at android.os.Parcel.readValue(Parcel.java:2264) 
                                               at android.os.Parcel.readArrayMapInternal(Parcel.java:2614) 
                                               at android.os.BaseBundle.unparcel(BaseBundle.java:221) 
                                               at android.os.BaseBundle.getString(BaseBundle.java:920) 
                                               at android.content.Intent.getStringExtra(Intent.java:6183) 
                                               at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:2706) 
                                               at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:2171) 
                                               at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:6359) 
                                               at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:6127) 
                                               at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:170) 
                                               at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3999) 
                                               at android.os.Binder.execTransact(Binder.java:453) 
                                            Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available 

Has anyone faced a similar problem?

Thank you in advance.

  • Are u using Android Studio 2.3 to sign apk? – Atef Hares Mar 19 '17 at 17:40
  • Yes and from what I can see, Android Studio updated in the mid-time between old apk and the new one. Is this a compatibility issue? Do we have to configure something else? – Giorgos Pippos Mar 19 '17 at 18:31
  • 2
    I had an issue in release apk , i was not able to install it, that was happening if the signature v2 is checked so if you checked v2 try to uncheck it and use only v1 (the jar signature). – Atef Hares Mar 19 '17 at 19:02
  • Now it is working! The apk created installed on the device and the app is working properly! Thank you for your feedback Atef Hares! – Giorgos Pippos Mar 19 '17 at 20:33
  • Glad I could help :) – Atef Hares Mar 19 '17 at 20:35
  • 1
    @AtefHares you should make that an answer. It worked for me also in debug. Also, [here is a post with more information on the differences](https://stackoverflow.com/questions/42648499/difference-between-signature-versions-v1jar-signature-and-v2full-apk-signat) – codeMagic Aug 31 '17 at 20:10
  • 1
    @codeMagic done! glad I could help you too :) – Atef Hares Aug 31 '17 at 20:23

2 Answers2

8

I had a similar issue before while releasing apk, i was not able to install it, that was happening if the signature v2 is checked.

Unfortunately, I am not really sure why it causes such problems! anyway if you checked v2 try to uncheck it and use only v1 (the jar signature).


Also thanks to @codeMagic for providing us with this STO thread about differences between both types.

Atef Hares
  • 4,715
  • 3
  • 29
  • 61
1

I fixed that the same which mentioned above, by applying v1 signing only and turn off v2 signing, moreover that can be done through gradle build file by settings value for v1SigningEnabled & v2SigningEnabled as the following:

signingConfigs {
    staging {
        keyAlias *****
        keyPassword *****
        storeFile file(*****)
        storePassword *****
        v1SigningEnabled true
        v2SigningEnabled false
    }
    release {
        keyAlias *****
        keyPassword *****
        storeFile file(*****)
        storePassword *****
        v1SigningEnabled true
        v2SigningEnabled false
    }
}
Ayman Mahgoub
  • 4,152
  • 1
  • 30
  • 27