AyogoHealth / cordova-plugin-update-notifier

Cordova plugin for showing a notification for app updates.
Apache License 2.0
27 stars 10 forks source link

Application crashes after downloading the update #11

Open nikolayanchev opened 3 years ago

nikolayanchev commented 3 years ago

So here s the problem, after installing the plugin and running the application i get the new version is available, i click on install, the new version start downloading, but right after is finishes the application crashes. After looking in the logs i discovered the folowing error E/AndroidRuntime: FATAL EXCEPTION: main Process: xxx.xxx.xxx , PID: 25586 java.lang.RuntimeException: Error receiving broadcast Intent { act=com.google.android.play.core.install.ACTION_INSTALL_STATUS flg=0x40000010 pkg=xxx.xxx.xxx (has extras) } in com.google.android.play.core.listener.a@3fced1a at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52226(LoadedApk.java:1329) at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.$m$0(Unknown Source:4) at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.run(Unknown Source:0) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: android.view.InflateException: Binary XML file line #26: Binary XML file line #26: Error inflating class <unknown> Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class <unknown> Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:334) at android.view.LayoutInflater.createView(LayoutInflater.java:647) at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:720) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) at android.view.LayoutInflater.rInflate(LayoutInflater.java:863) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at com.google.android.material.snackbar.Snackbar.make(Snackbar.java:188) at com.ayogo.cordova.updatenotifier.UpdateNotifierPlugin$3.run(UpdateNotifierPlugin.java:150) at android.app.Activity.runOnUiThread(Activity.java:6281) at com.ayogo.cordova.updatenotifier.UpdateNotifierPlugin.popupSnackbarForCompleteUpdate(UpdateNotifierPlugin.java:144) at com.ayogo.cordova.updatenotifier.UpdateNotifierPlugin.access$000(UpdateNotifierPlugin.java:41) at com.ayogo.cordova.updatenotifier.UpdateNotifierPlugin$1.onStateUpdate(UpdateNotifierPlugin.java:68) at com.ayogo.cordova.updatenotifier.UpdateNotifierPlugin$1.onStateUpdate(UpdateNotifierPlugin.java:64) at com.google.android.play.core.listener.b.i(Unknown Source:24) at com.google.android.play.core.appupdate.a.a(Unknown Source:182) at com.google.android.play.core.listener.a.onReceive(Unknown Source:2) at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52226(LoadedApk.java:1319) at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.$m$0(Unknown Source:4) at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.run(Unknown Source:0) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x101009b a=1} at android.content.res.TypedArray.getColorStateList(TypedArray.java:538) at android.widget.TextView.<init>(TextView.java:1255) at android.widget.TextView.<init>(TextView.java:1145) at android.widget.TextView.<init>(TextView.java:1141) at java.lang.reflect.Constructor.newInstance0(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:334)  at android.view.LayoutInflater.createView(LayoutInflater.java:647)  at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:720)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)  at android.view.LayoutInflater.inflate(LayoutInflater.java:515)  at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at com.google.android.material.snackbar.Snackbar.make(Snackbar.java:188)  at com.ayogo.cordova.updatenotifier.UpdateNotifierPlugin$3.run(UpdateNotifierPlugin.java:150)  at android.app.Activity.runOnUiThread(Activity.java:6281)  at com.ayogo.cordova.updatenotifier.UpdateNotifierPlugin.popupSnackbarForCompleteUpdate(UpdateNotifierPlugin.java:144)  at com.ayogo.cordova.updatenotifier.UpdateNotifierPlugin.access$000(UpdateNotifierPlugin.java:41)  at com.ayogo.cordova.updatenotifier.UpdateNotifierPlugin$1.onStateUpdate(UpdateNotifierPlugin.java:68)  at com.ayogo.cordova.updatenotifier.UpdateNotifierPlugin$1.onStateUpdate(UpdateNotifierPlugin.java:64)  at com.google.android.play.core.listener.b.i(Unknown Source:24)  at com.google.android.play.core.appupdate.a.a(Unknown Source:182)  at com.google.android.play.core.listener.a.onReceive(Unknown Source:2)  at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_52226(LoadedApk.java:1319)  at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.$m$0(Unknown Source:4)  at android.app.-$Lambda$FilBqgnXJrN9Mgyks1XHeAxzSTk.run(Unknown Source:0)  at android.os.Handler.handleCallback(Handler.java:789)  at android.os.Handler.dispatchMessage(Handler.java:98)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6944)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 

I am using cordova 10.0.0 with android 9.0.0 with these plugins "cordova-plugin-splashscreen": {}, "cordova-plugin-geolocation": {}, "cordova-plugin-device": {}, "cordova-plugin-network-information": {}, "cordova-plugin-brightness": {}, "cordova-plugin-firebasex": { "FIREBASE_ANALYTICS_COLLECTION_ENABLED": "true", "FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "true", "FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "true", "ANDROID_ICON_ACCENT": "#DD0332", "ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION": "17.0.0", "ANDROID_FIREBASE_ANALYTICS_VERSION": "17.2.1", "ANDROID_FIREBASE_MESSAGING_VERSION": "20.0.0", "ANDROID_FIREBASE_CONFIG_VERSION": "19.0.3", "ANDROID_FIREBASE_PERF_VERSION": "19.0.1", "ANDROID_FIREBASE_AUTH_VERSION": "19.1.0", "ANDROID_CRASHLYTICS_VERSION": "2.10.1", "ANDROID_CRASHLYTICS_NDK_VERSION": "2.1.1" }, "cordova-plugin-whitelist": {}, "cordova-plugin-update-notifier": {} ` So the question is, does this plugin require somekind of permission? Does it require some additional configuration? maybe both?

bbialas commented 2 years ago

I have the same error, any ideas?

dpogue commented 2 years ago

What version of the plugin are you using? Does your Cordova Android project have AndroidX enabled?

nikolayanchev commented 2 years ago

I have the same error, any ideas?

i have done a manual check for updates, i wrote a simple script that gets the current version in the store and saves it on our server, the app checks against that