Question:
My Cordova application crashes on the Android device with the following exception. How could it be resolved?
E/Pushwoosh: [PushwooshLocation] [GetNearestZoneJobApplier] failed update nearest geoZones Location not found
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
Process: com.xandgo.fourtraders, PID: 12144
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.IllegalArgumentException: Error: requested job be persisted without holding RECEIVE_BOOT_COMPLETED permission.
at android.os.Parcel.readException(Parcel.java:1625)
at android.os.Parcel.readException(Parcel.java:1574)
at android.app.job.IJobScheduler$Stub$Proxy.schedule(IJobScheduler.java:121)
at android.app.JobSchedulerImpl.schedule(JobSchedulerImpl.java:42)
at com.pushwoosh.location.c.b.a(Unknown Source)
at com.pushwoosh.location.c.b.a(Unknown Source)
at com.pushwoosh.location.c.e.a(Unknown Source)
at com.pushwoosh.location.c.a(Unknown Source)
at com.pushwoosh.location.network.b.a(Unknown Source)
at com.pushwoosh.location.network.c.process(Unknown Source)
at com.pushwoosh.location.network.c.a.a(Unknown Source)
at com.pushwoosh.location.network.b.a(Unknown Source)
at com.pushwoosh.location.network.GeoLocationServiceApi21$a.a(Unknown Source)
at com.pushwoosh.location.network.GeoLocationServiceApi21$a.doInBackground(Unknown Source)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Answer:
Generally, this crash is caused due to the lack of location tracking permissions for the latest versions of Android.
https://github.com/Pushwoosh/pushwoosh-phonegap-plugin/blob/master/plugin.xml#L40
<!--<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />--> <!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />--> <!----> <!--<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />-->
Please note that according to our Cordova customizing plugin guide, it is necessary to add permissions above(for Android platform).
Comments
0 comments
Please sign in to leave a comment.