gjedeer / mylocation

Share your location on Android - with Email, SMS, Conversations, Tox, Whatsapp etc
https://f-droid.org/repository/browse/?fdid=net.mypapit.mobile.myposition
GNU General Public License v2.0
30 stars 14 forks source link

Fatal App Crash Because Provider 'network' Does Not Exist #8

Closed xee5ch closed 8 years ago

xee5ch commented 8 years ago

I really like the screenshots and the description on F-Droid. I am running on a Moto E XT1521 with Android 6.0.1, using CyanogenMod (13.0-20160519-NIGHTLY-surnia). I downloaded your app with the current stable F-Droid client. Every time I have tried to run the app (full disclosure: I use the Xposed system calll interception framework, along with XPrivacy, but have allowed all system calls in testing), it crashes. Below is the logcat sample.

06-03 13:54:26.558 22377 22377 D net.mypapit.mobile.myposition: preference retrieved 3000ms
06-03 13:54:26.579 22377 22377 D net.mypapit.mobile.myposition: GPS location requested from thread
06-03 13:54:26.586 22377 22377 D AndroidRuntime: Shutting down VM
06-03 13:54:26.589 22377 22377 E AndroidRuntime: FATAL EXCEPTION: main
06-03 13:54:26.589 22377 22377 E AndroidRuntime: Process: net.mypapit.mobile.myposition, PID: 22377
06-03 13:54:26.589 22377 22377 E AndroidRuntime: Theme: themes:{}
06-03 13:54:26.589 22377 22377 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity {net.mypapit.mobile.myposition/net.
mypapit.mobile.myposition.MyLocationActivity}: java.lang.IllegalArgumentException: provider doesn't exist: network                       
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3137)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3168)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2515)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.app.ActivityThread.-wrap11(ActivityThread.java)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:102)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:5461)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:134)
06-03 13:54:26.589 22377 22377 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: provider doesn't exist: network
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.os.Parcel.readException(Parcel.java:1624)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.os.Parcel.readException(Parcel.java:1573)
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationMa
nager.java:606)                                                                                                                          
06-03 13:54:26.589 22377 22377 E AndroidRuntime:        at android.location.LocationManager.requestLocationUpdates(LocationManager.java:89
2)

Judging from reports on other location libraries and with the Genymotion emulator, I assume my customizations might be an issue, but it seems maybe not? XPrivacy does not prompt for network access, and others suggest, the providers must be iterated through instead of directly assuming it is accessible.

https://github.com/mrmans0n/smart-location-lib/issues/11

https://github.com/mrmans0n/smart-location-lib/issues/24

Sorry, I am an Android development newbie. Is there anything else I can do to help?

gjedeer commented 8 years ago

provider doesn't exist: network

It seems that your system doesn't allow network location providers. If you can wait, I'll patch that "soon" (when I have free time)

If you want to have it now, try installing https://f-droid.org/repository/browse/?fdfilter=nlp&fdid=com.google.android.gms

gjedeer commented 8 years ago

And if you want to help and know how to build the app from source, you could change

https://github.com/gjedeer/mylocation/blob/master/src/net/mypapit/mobile/myposition/MyLocationActivity.java#L224

and wrap each requestLocationUpdates() call in if's, so that:

if network_location_is_available:
    locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, time, distance, this);

etc. Where "network_location_is_available" is something you need to find in google API docs - I don't know the actual method name.

xee5ch commented 8 years ago

Ok, well since you took the time, I will make an effort to learn how to build your app and try to contribute back. That was a rapid and detailed response.

If not this weekend, next weekend. I will get back to you. Thanks for porting this over from Google Code. From screenshots, this is basically the only app that filled a niche I was looking for.

gjedeer commented 8 years ago

Yeah, i was looking for something to fill that niche myself and found this abandoned app.

Anyway, don't feel too obliged to do that ✌

Sent from my Android device with K-9 Mail. Please excuse my brevity.

gjedeer commented 8 years ago

build.board: smdk4x12 build.bootloader: N7100XXUFOB1 build.brand: samsung build.cpu_abi: armeabi-v7a build.cpu_abi2: armeabi build.device: t03g build.display: cm_n7100-userdebug 4.4.4 KTU84Q aa8aa93211 test-keys build.fingerprint: samsung/t03gxx/t03g:4.3/JSS15J/N7100XXUENB2:user/release-keys build.hardware: smdk4x12 build.host: cyanogenmod build.id: KTU84Q build.manufacturer: samsung build.model: GT-N7100 build.product: t03gxx build.radio: unknown build.serial: 4df7ce886274cf6f build.tags: test-keys build.time: 1412767754000 build.type: userdebug build.user: jenkins version.codename: REL version.incremental: aa8aa93211 version.release: 4.4.4 version.sdk_int: 19

08-19 09:18:39.685 I/ActivityManager(2360): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10304000 cmp=net.mypapit.mobile.myposition/.MyLocationActivity bnds=[304,676][632,966]} from pid 2579 08-19 09:18:39.840 I/ActivityManager(2360): Start proc net.mypapit.mobile.myposition for activity net.mypapit.mobile.myposition/.MyLocationActivity: pid=25081 uid=10192 gids={50192} 08-19 09:18:39.935 W/XPrivacy(25081): Hooking package=net.mypapit.mobile.myposition 08-19 09:18:39.950 D/ActivityThread(25081): handleBindApplication:net.mypapit.mobile.myposition 08-19 09:18:40.020 D/net.mypapit.mobile.myposition(25081): preference retrieved 1000ms 08-19 09:18:40.030 D/net.mypapit.mobile.myposition(25081): GPS location requested from thread 08-19 09:18:40.045 E/AndroidRuntime(25081): Process: net.mypapit.mobile.myposition, PID: 25081 08-19 09:18:40.045 E/AndroidRuntime(25081): java.lang.RuntimeException: Unable to resume activity {net.mypapit.mobile.myposition/net.mypapit.mobile.myposition.MyLocationActivity}: java.lang.IllegalArgumentException: provider doesn't exist: network 08-19 09:18:40.045 E/AndroidRuntime(25081): at net.mypapit.mobile.myposition.MyLocationActivity.registerLocationListener(MyLocationActivity.java:259) 08-19 09:18:40.045 E/AndroidRuntime(25081): at net.mypapit.mobile.myposition.MyLocationActivity.onResume(MyLocationActivity.java:122) 08-19 09:18:40.045 W/ActivityManager(2360): Force finishing activity net.mypapit.mobile.myposition/.MyLocationActivity 08-19 09:18:40.685 W/ActivityManager(2360): Activity pause timeout for ActivityRecord{432910f8 u0 net.mypapit.mobile.myposition/.MyLocationActivity t43 f} 08-19 09:18:41.380 I/ActivityManager(2360): Process net.mypapit.mobile.myposition (pid 25081) has died. 08-19 09:18:43.175 I/ActivityManager(2360): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10304000 cmp=net.mypapit.mobile.myposition/.MyLocationActivity} from pid 2579 08-19 09:18:43.490 I/ActivityManager(2360): Start proc net.mypapit.mobile.myposition for activity net.mypapit.mobile.myposition/.MyLocationActivity: pid=25251 uid=10192 gids={50192} 08-19 09:18:43.550 W/XPrivacy(25251): Hooking package=net.mypapit.mobile.myposition 08-19 09:18:43.565 D/ActivityThread(25251): handleBindApplication:net.mypapit.mobile.myposition 08-19 09:18:43.650 D/net.mypapit.mobile.myposition(25251): preference retrieved 1000ms 08-19 09:18:43.660 D/net.mypapit.mobile.myposition(25251): GPS location requested from thread 08-19 09:18:43.665 E/AndroidRuntime(25251): Process: net.mypapit.mobile.myposition, PID: 25251 08-19 09:18:43.665 E/AndroidRuntime(25251): java.lang.RuntimeException: Unable to resume activity {net.mypapit.mobile.myposition/net.mypapit.mobile.myposition.MyLocationActivity}: java.lang.IllegalArgumentException: provider doesn't exist: network 08-19 09:18:43.665 E/AndroidRuntime(25251): at net.mypapit.mobile.myposition.MyLocationActivity.registerLocationListener(MyLocationActivity.java:259) 08-19 09:18:43.665 E/AndroidRuntime(25251): at net.mypapit.mobile.myposition.MyLocationActivity.onResume(MyLocationActivity.java:122) 08-19 09:18:43.685 W/ActivityManager(2360): Force finishing activity net.mypapit.mobile.myposition/.MyLocationActivity 08-19 09:18:44.520 W/ActivityManager(2360): Activity pause timeout for ActivityRecord{432a8498 u0 net.mypapit.mobile.myposition/.MyLocationActivity t44 f} 08-19 09:18:45.400 I/ActivityManager(2360): Process net.mypapit.mobile.myposition (pid 25251) has died.

xee5ch commented 8 years ago

Sorry for the delay. So you're getting the same now too?

gjedeer commented 8 years ago

I've built a version with a possible fix https://f.gdr.name/MyLocationActivity-release.apk

gjedeer commented 8 years ago

@xee5ch any feedback?

xee5ch commented 8 years ago

Ironically downloaded last night. I have not had a chance to test. Maybe this evening?

On October 12, 2016 3:00:54 PM GMT+03:00, GDR! notifications@github.com wrote:

@xee5ch any feedback?

xee5ch commented 8 years ago

Tested and it is working for me. You definitely pulled my weight. Thanks for the great app and patiently working on a solution.