13 Replies Latest reply on Nov 9, 2017 4:53 AM by svantej81806167

    The package appears to be corrupt

    marekw29839557 Level 1



      I'm getting the following error when installing apps built with PhoneGap Build.


      "The package appears to be corrupt".


      Nexus 5X with Android 7.0 Nougat


      cli-6.3.0 has never worked for me but as of today 6.2.0 and 6.1.0 are also producing this error. The same code base worked OK on Friday with cli.6.2.0.




        • 1. Re: The package appears to be corrupt
          VectorP Level 4

          Would be useful to see the package: is your zip file available online, somewhere?

          (Possible cause could be that you are including files that shouldnt be there, like androidManifest.xml, plugins.xml, /hooks, /platforms or cordova.js)

          • 2. Re: The package appears to be corrupt
            marekw29839557 Level 1



            Exactly the same package installed OK on Friday. I haven't added or removed any files. I edited one javascript file, but I've since rolled that back to the version I had on Friday.




            • 3. Re: The package appears to be corrupt
              marekw29839557 Level 1

              Just noticed this in the log:


              No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2041-12-22) or after any future revocation date.

              • 4. Re: The package appears to be corrupt
                mattk91945366 Level 1

                I'm having the same issue.

                • 5. Re: The package appears to be corrupt
                  mattk91945366 Level 1

                  This is happening to me on Android Nexus 5, but it's also happening to me on the iPad.


                  I haven't changed any configs. I just increased version numbers + changed simple Javascript. Nothing that would cause this corruption. The iOS error message is:


                  Unable to Download App

                  "*App Name Here*" could not be installed at this time.


                  This happens when I use the QR Scanner to install the app. That method has worked for me for over a year, but today both iOS + Android are failing. This has to be something non-codebase related.

                  • 6. Re: The package appears to be corrupt
                    marekw29839557 Level 1

                    Any news on this? Still not working this morning.




                    • 7. Re: The package appears to be corrupt
                      peterw36363536 Level 1

                      I'm getting the same error trying to install unsigned Android builds on a Nexus 5X running Android 7.0 with the September 2016 Android update.

                      • The Phonegap Build log does not have any tsa/cert messages.
                      • I get the same error whether the app has debugging enabled via the Phonegap Build web UI or not.
                      • I get the same error whether I use the QR code to install or by manually downloading the .apk (e.g. from https://build.phonegap.com/apps/NNN/install).
                      • The build installs & runs fine on a different device running Android 4.x.
                      • iOS builds (signed with an iOS dev key) install & run fine.


                      In my case, I hadn't rebuilt the app in two weeks. Today I updated some image files and JS logic, but made no changes to plugins, config.xml, etc. I have not tried to revert to yesterday's code.

                      • 8. Re: The package appears to be corrupt
                        peterw36363536 Level 1

                        marekw29839557 this looks like this is just a versioning problem. Using "adb install" I got error INSTALL_FAILED_VERSION_DOWNGRADE for the new .apk I manually downloaded. Using "adb shell" and "pm uninstall -k" to remove the old version, I was then able to use "adb install" to install the .apk and all my app data was available, just as would have been the case with a clean app upgrade.

                        • 9. Re: The package appears to be corrupt
                          mattk91945366 Level 1

                          You're saying you removed the old version and installed a fresh new one?


                          If so, any thoughts on what the problem is so that this doesn't affect customers who require an update without reinstall?

                          • 10. Re: The package appears to be corrupt
                            peterw36363536 Level 1

                            That's right. I used ADB/pm so that I could keep the app data on my device, but I expect if I had used the normal Android on-device UI to fully uninstall, that also would have worked.


                            My guess about what's happened:

                            1) Phonegap Build behavior has changed, that it used to perform some sort of auto increment on the Android version info in the final .apk, and no longer does. So projects that don't explicitly set full version info in their source code / configuration started building packages with versions that were the same as (or at least not greater/newer) than before.

                            2) Android 7.0 is displaying error messages that are incorrect and misleading. The .apk is fine, it's really being rejected due to the embedded version info.

                            • 11. Re: The package appears to be corrupt
                              marekw29839557 Level 1

                              I update "android-versionCode" to a higher number but I still have the same problem with the apk being "corrupt".





                              <?xml version="1.0" encoding="UTF-8" ?>


                                      xmlns              = "http://www.w3.org/ns/widgets"

                                      xmlns:gap          = "http://phonegap.com/ns/1.0"

                                      xmlns:android    = "http://schemas.android.com/apk/res/android"

                                      id                 = "com.marekwalford.xxx"

                                      version            = "0.11.3"









                                  <author href="http://www.marekwalford.co.uk" email="marek.walford@gmail.com">

                                      Marek Walford



                                  <platform name="android" />


                                  <preference name="phonegap-version" value="cli-6.3.0" />

                                  <preference name="android-minSdkVersion" value="19" />

                                  <preference name="android-targetSdkVersion" value="23" />

                                  <preference name="android-versionCode" value="39230" />

                                  <preference name="permissions" value="none"/>

                                  <preference name="SplashScreen" value="screen" />

                                  <preference name="SplashScreenDelay" value="1000000" />

                                  <preference name="SplashMaintainAspectRatio" value="true" />

                                  <preference name="AutoHideSplashScreen" value="false" />

                                  <preference name="SplashScreenBackgroundColor" value="black" />

                                  <preference name="FadeSplashScreen" value="false" />

                                  <preference name="ShowSplashScreenSpinner" value="false" />


                                  <splash src="splash-portrait.png" gap:platform="android" gap:density="ldpi" gap:qualifier="port-ldpi" />

                                  <splash src="splash-portrait.png" gap:platform="android" gap:density="mdpi" gap:qualifier="port-mdpi" />

                                  <splash src="splash-portrait.png" gap:platform="android" gap:density="hdpi" gap:qualifier="port-hdpi" />

                                  <splash src="splash-portrait.png" gap:platform="android" gap:density="xhdpi" gap:qualifier="port-xhdpi" />

                                  <splash src="splash-landscape.png" gap:platform="android" gap:density="ldpi" width="320" height="200" gap:qualifier="land-ldpi" />

                                  <splash src="splash-landscape.png" gap:platform="android" gap:density="mdpi" width="480" height="320" gap:qualifier="land-mdpi" />

                                  <splash src="splash-landscape.png" gap:platform="android" gap:density="hdpi" width="800" height="480" gap:qualifier="land-hdpi" />

                                  <splash src="splash-landscape.png" gap:platform="android" gap:density="xhdpi" width="1280" height="720" gap:qualifier="land-xhdpi" />


                                  <plugin name="cordova-plugin-device" spec="1.1.3" source="npm" />

                                  <plugin name="cordova-plugin-file" spec="4.3.0" source="npm" />

                                  <plugin name="cordova-plugin-media" spec="2.4.0" source="npm" />

                                  <plugin name="cordova-plugin-splashscreen" spec="4.0.0" source="npm" />

                                  <plugin name="cordova-plugin-dialogs" spec="1.3.0" source="npm" />

                                  <plugin name="cordova.plugins.diagnostic" spec="3.2.0" source="npm" />

                                  <plugin name="cordova-plugin-buildinfo" spec="1.1.0" source="npm" />  

                                  <plugin name="cordova-plugin-androidlicense" spec="1.0.3" source="npm" />  

                                  <plugin name="cordova-plugin-spinner" spec="1.1.0" source="npm" />

                                  <plugin name="cordova-plugin-photokandy-video-thumbnail" spec="2.1.0" source="npm" />

                                  <plugin name="cordova-plugin-zip" spec="3.1.0" source="npm" />

                                  <plugin name="cordova-plugin-pdialog" spec="2.0.1" source="npm" />


                                  <icon src="icon.png" />


                              • 12. Re: The package appears to be corrupt
                                marekw29839557 Level 1

                                Sorry, just realised a typo on my part. You're correct that the versioncode needed to be higher.


                                Thanks very much!

                                • 13. Re: The package appears to be corrupt
                                  svantej81806167 Level 1

                                  Remove the existing app and then install the new one. Worked for me.