vaenow / cordova-plugin-app-update

App updater for Cordova/PhoneGap
MIT License
298 stars 146 forks source link

App crashed after download #137

Open dzero1 opened 5 years ago

dzero1 commented 5 years ago

Got a exception like this,

08-26 17:24:31.757 26250 26308 E AndroidRuntime: FATAL EXCEPTION: JavaBridge
08-26 17:24:31.757 26250 26308 E AndroidRuntime: Process: com.headstartcloud.singer, PID: 26250
08-26 17:24:31.757 26250 26308 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.PackageItemInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
08-26 17:24:31.757 26250 26308 E AndroidRuntime:    at android.support.v4.content.FileProvider.parsePathStrategy(FileProvider.java:584)
08-26 17:24:31.757 26250 26308 E AndroidRuntime:    at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:558)
08-26 17:24:31.757 26250 26308 E AndroidRuntime:    at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:400)
08-26 17:24:31.757 26250 26308 E AndroidRuntime:    at com.vaenow.appupdate.android.DownloadHandler.installApk(DownloadHandler.java:107)
08-26 17:24:31.757 26250 26308 E AndroidRuntime:    at com.vaenow.appupdate.android.DownloadHandler.handleMessage(DownloadHandler.java:60)
08-26 17:24:31.757 26250 26308 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:105)
08-26 17:24:31.757 26250 26308 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:156)
08-26 17:24:31.757 26250 26308 E AndroidRuntime:    at android.os.HandlerThread.run(HandlerThread.java:61)

Device : Huawei MediaPad T3 10 Model number : AGS-l09 EMUI - 5.1 Android version 7.0

Now I'm using ionic-angular 3.9.2, app-update "^4.20.0" and cordova-android "8.0.0". But I guess this happen on some older plugin version.

This is the only device I have the issue with. My clients says some other mobile devices have same issue. But in some devices working perfectly.

Willovent commented 5 years ago

I have the same issue . Here is my stacktrace

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
    at android.support.v4.content.FileProvider.parsePathStrategy(FileProvider.java:605)
    at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:579)
    at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:417)
    at com.vaenow.appupdate.android.DownloadHandler.installApk(DownloadHandler.java:107)
    at com.vaenow.appupdate.android.DownloadHandler.handleMessage(DownloadHandler.java:60)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:201)
    at android.os.HandlerThread.run(HandlerThread.java:65)
Willovent commented 5 years ago

On my side, it was because I was changing the packageId on the build.gradle file but not on the main activity (In a multi-tenant & environment application). I don't have this problem anymore.

abangrephol commented 5 years ago

Somehow the config-file that should be added to AndroidManifest.xml from the plugin.xml gone missing after build, it happen to me too past few days and i guess i found tricky solution for it

add below xml tags to config.xml `

`

it from plugin.xml file inside plugins/cordova-plugin-app-update

you can reproduce the problem by removing platform then add platform again

Sorry for bad english, i hope it helps

NareshKukreti12 commented 3 years ago

Did you find the solution? I facing the same issue.