[Android Apps and Games] jeppo:
Crash on CM13 / issue with mock location

I'm also having issues with crash after clicking on the joystick button (Nexus 5 running CM13, root method only).

Luckily, I can add some information on why it is not working First of all, version fd58250[1470741040] (~1 week ago) was running but the GSP position was not overridden (PkGo buddy was still on my real position). Recently, with d7a91a9[1471071392] it crashes right after pressing the joystick button. By looking at Android logs looks like CM13 throws a SecurityException that prevents pokemodex to set a fake GPS position if not explicitly set as mock location application in developer settings.

This is the logcat of the session with the crash:

08-13 12:57:50.390 808 1563 I ActivityManager: START u0 {flg=0x10000 cmp=com.roswell108.pokemodex/.services.MainActivity} from uid 10115 on display 0

08-13 12:57:50.417 4261 4261 I p : Making Creator dynamically

08-13 12:57:50.457 4261 4261 D ChimeraCfgMgr: Reading stored module config

08-13 12:57:50.479 4261 4261 W System : ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000007/n/armeabi-v7a

08-13 12:57:50.480 4261 4261 W System : ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000007/n/armeabi

08-13 12:57:50.481 4261 4261 D ChimeraFileApk: Primary ABI of requesting process is armeabi-v7a

08-13 12:57:50.482 4261 4261 D ChimeraFileApk: Classloading successful. Optimized code found.

08-13 12:57:50.525 4261 4261 I Google Maps Android API: Google Play services client version: 8487000

08-13 12:57:50.530 4261 4261 I Google Maps Android API: Google Play services package version: 9452438

08-13 12:57:50.731 4261 4261 I c : Token loaded from file. Expires in: 430463195 ms.

08-13 12:57:50.731 4261 4261 I c : Scheduling next attempt in 430163 seconds.

08-13 12:57:50.830 4261 5629 W ActivityThread: ClassLoader.loadClass: The class loader returned by Thread.getContextClassLoader() may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example: Thread.setContextClassLoader(getClass().getClassLoader());

08-13 12:57:50.837 4261 5629 W System : ClassLoader referenced unknown path: /system/framework/tcmclient.jar

08-13 12:57:50.924 4261 4261 I WebViewFactory: Loading com.android.webview version 51.0.2704.106 (code 1)

08-13 12:57:50.968 4261 4261 W System : ClassLoader referenced unknown path: /system/app/webview/lib/arm

08-13 12:57:50.977 4261 4261 I cr_LibraryLoader: Time to load native libraries: 3 ms (timestamps 4682-4685)

08-13 12:57:50.977 4261 4261 I cr_LibraryLoader: Expected native library version number "51.0.2704.106", actual native library version number "51.0.2704.106"

08-13 12:57:50.999 4261 4261 V WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {654e170}

08-13 12:57:50.999 4261 4261 I cr_LibraryLoader: Expected native library version number "51.0.2704.106", actual native library version number "51.0.2704.106"

08-13 12:57:51.000 4261 4261 I chromium: [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0

08-13 12:57:51.016 4261 4261 I cr_BrowserStartup: Initializing chromium process, singleProcess=true

08-13 12:57:51.026 4261 4261 E ApkAssets: Error while loading asset assets/natives_blob_64.bin: java.io.FileNotFoundException: assets/natives_blob_64.bin

08-13 12:57:51.026 4261 4261 E ApkAssets: Error while loading asset assets/snapshot_blob_64.bin: java.io.FileNotFoundException: assets/snapshot_blob_64.bin

08-13 12:57:51.047 4261 4261 I Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb

08-13 12:57:51.127 4261 4261 I cr_DRP : No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp

08-13 12:57:51.131 4261 5663 W cr_media: Requires BLUETOOTH permission

08-13 12:57:51.153 808 1551 D ConnectivityService: listenForNetwork for Listen from uid/pid:10115/4261 for NetworkRequest [ id=10, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]

08-13 12:57:51.170 4261 4261 D cr_Ime : [InputMethodManagerWrapper.java:30] Constructor

08-13 12:57:51.179 4261 4261 W cr_AwContents: onDetachedFromWindow called when already detached. Ignoring

08-13 12:57:51.180 4261 4261 D cr_Ime : [InputMethodManagerWrapper.java:59] isActive: false

08-13 12:57:51.208 4261 5671 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

08-13 12:57:51.250 808 3110 D ConnectivityService: listenForNetwork for Listen from uid/pid:10115/4261 for NetworkRequest [ id=11, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]

08-13 12:57:51.262 4261 4261 W Google Maps Android API: Deprecation notice: In a future release, indoor will no longer be supported on satellite, hybrid or terrain type maps. Even where indoor is not supported, isIndoorEnabled() will continue to return the value that has been set via setIndoorEnabled(), as it does now. By default, setIndoorEnabled is 'true'. The API release notes (https://developers.google.com/maps/documentation/android-api/releases) will let you know when indoor support becomes unavailable on those map types.

08-13 12:57:51.327 4261 5671 I OpenGLRenderer: Initialized EGL, version 1.4

08-13 12:57:51.483 808 827 I ActivityManager: Displayed com.roswell108.pokemodex/.services.MainActivity: +1s83ms (total +21m55s207ms)

08-13 12:57:51.538 4261 5651 W Google Maps Android API: GLHudOverlay deprecated; getDrawOrder(): no-op, return DrawOrder.HEADS_UP_DISPLAY

08-13 12:57:51.804 4261 5651 W Google Maps Android API: GLHudOverlay deprecated; draw(): no-op

08-13 12:57:51.816 1744 4749 W GLSUser : [AppCertManager] IOException while requesting key:

08-13 12:57:51.816 1744 4749 W GLSUser : java.io.IOException: Invalid device key response.

08-13 12:57:51.816 1744 4749 W GLSUser :	at dxt.a(:com.google.android.gms:267)

08-13 12:57:51.816 1744 4749 W GLSUser :	at dxt.a(:com.google.android.gms:4235)

08-13 12:57:51.816 1744 4749 W GLSUser :	at dxs.a(:com.google.android.gms:47)

08-13 12:57:51.816 1744 4749 W GLSUser :	at dxm.a(:com.google.android.gms:55)

08-13 12:57:51.816 1744 4749 W GLSUser :	at dxl.a(:com.google.android.gms:113)

08-13 12:57:51.816 1744 4749 W GLSUser :	at com.google.android.gms.auth.account.be.legacy.AuthCronChimeraService.b(:com.google.android.gms:3054)

08-13 12:57:51.816 1744 4749 W GLSUser :	at dir.call(:com.google.android.gms:2045)

08-13 12:57:51.816 1744 4749 W GLSUser :	at java.util.concurrent.FutureTask.run(FutureTask.java:237)

08-13 12:57:51.816 1744 4749 W GLSUser :	at ixu.run(:com.google.android.gms:453)

08-13 12:57:51.816 1744 4749 W GLSUser :	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)

08-13 12:57:51.816 1744 4749 W GLSUser :	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)

08-13 12:57:51.816 1744 4749 W GLSUser :	at jch.run(:com.google.android.gms:17)

08-13 12:57:51.816 1744 4749 W GLSUser :	at java.lang.Thread.run(Thread.java:818)

08-13 12:57:51.826 4261 5651 W Google Maps Android API: GLHudOverlay deprecated; draw(): no-op

08-13 12:57:52.929 4261 5653 W DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.

08-13 12:57:52.932 4261 5653 I DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:1

08-13 12:57:52.932 4261 5653 I DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 1

08-13 12:57:52.938 4261 5653 W System : ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000006/n/armeabi

08-13 12:57:52.939 4261 5653 D ChimeraFileApk: Primary ABI of requesting process is armeabi-v7a

08-13 12:57:52.940 4261 5653 D ChimeraFileApk: Classloading successful. Optimized code found.

08-13 12:57:52.941 4261 5651 W Google Maps Android API: GLHudOverlay deprecated; draw(): no-op

08-13 12:57:52.943 4261 5653 D GoogleCertificates: com.google.android.gms.googlecertificates module is loaded

08-13 12:57:52.970 4261 5651 W Google Maps Android API: GLHudOverlay deprecated; draw(): no-op

08-13 12:57:52.998 4261 5653 D GoogleCertificatesImpl: Fetched 318 Google certificates

08-13 12:57:56.157 808 818 I art : Background partial concurrent mark sweep GC freed 112880(8MB) AllocSpace objects, 35(764KB) LOS objects, 33% free, 29MB/44MB, paused 2.081ms total 156.103ms

08-13 12:57:56.179 4261 4261 D AndroidRuntime: Shutting down VM

08-13 12:57:56.179 4261 4261 W System.err: java.lang.SecurityException: In order to use mock mode functionality app com.roswell108.pokemodex must be selected as the mock location application in developer settings.

08-13 12:57:56.180 4261 4261 W System.err:	at android.os.Parcel.readException(Parcel.java:1620)

08-13 12:57:56.180 4261 4261 W System.err:	at android.os.Parcel.readException(Parcel.java:1573)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.location.internal.k$a$a.a(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.location.internal.m.a(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.location.internal.n.a(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.location.internal.e.a(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.location.internal.e.b(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.common.api.internal.b$a.a(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.common.api.internal.h.a(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.common.api.internal.h.a(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.common.api.internal.t.a(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.common.api.internal.p.a(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.google.android.gms.location.internal.d.a(Unknown Source)

08-13 12:57:56.180 4261 4261 W System.err:	at com.roswell108.pokemodex.a.d.a(MockHandler.java:542)

08-13 12:57:56.180 4261 4261 W System.err:	at com.roswell108.pokemodex.a.d.d(MockHandler.java:146)

08-13 12:57:56.180 4261 4261 W System.err:	at com.roswell108.pokemodex.a.d.d(MockHandler.java:89)

08-13 12:57:56.180 4261 4261 W System.err:	at com.roswell108.pokemodex.a.f.a(MockHandler.java:566)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.internal.k.a(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.api.internal.p.a(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.api.internal.k.g(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.api.internal.k.a(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.api.internal.t.a(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.api.internal.d.a(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.internal.j$g.a(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.internal.j$a.a(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.internal.j$a.a(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.internal.j$c.c(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at com.google.android.gms.common.internal.j$b.handleMessage(Unknown Source)

08-13 12:57:56.181 4261 4261 W System.err:	at android.os.Handler.dispatchMessage(Handler.java:102)

08-13 12:57:56.181 4261 4261 W System.err:	at android.os.Looper.loop(Looper.java:148)

08-13 12:57:56.181 4261 4261 W System.err:	at android.app.ActivityThread.main(ActivityThread.java:5461)

08-13 12:57:56.181 4261 4261 W System.err:	at java.lang.reflect.Method.invoke(Native Method)

08-13 12:57:56.181 4261 4261 W System.err:	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)

08-13 12:57:56.181 4261 4261 W System.err:	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

08-13 12:57:56.561 808 3109 I WindowState: WIN DEATH: Window{6b475db u0 com.roswell108.pokemodex/com.roswell108.pokemodex.services.MainActivity}

08-13 12:57:56.565 808 1571 I WindowState: WIN DEATH: Window{557269a u0 com.roswell108.pokemodex}

08-13 12:57:56.565 808 1571 W AppOps : Finishing op nesting under-run: uid 10115 pkg com.roswell108.pokemodex code 24 time=0 duration=0 nesting=0

08-13 12:57:56.631 808 1997 I ActivityManager: Process com.roswell108.pokemodex (pid 4261) has died

08-13 12:57:56.632 808 1997 W ActivityManager: Scheduling restart of crashed service com.roswell108.pokemodex/.services.PokeService in 1000ms

08-13 12:57:56.632 808 1997 W ActivityManager: Scheduling restart of crashed service com.roswell108.pokemodex/.services.PokeDebug in 11000ms

08-13 12:57:57.668 808 822 I ActivityManager: Start proc 5747:com.roswell108.pokemodex/u0a115 for service com.roswell108.pokemodex/.services.PokeService

08-13 12:57:57.742 5747 5747 W System : ClassLoader referenced unknown path: /system/priv-app/PokeModEX/lib/arm

08-13 12:57:57.747 5747 5747 I MultiDex: VM with version 2.1.0 has multidex support

08-13 12:57:57.747 5747 5747 I MultiDex: install

08-13 12:57:57.747 5747 5747 I MultiDex: VM has multidex support, MultiDex support library is disabled.

08-13 12:57:58.176 808 808 W NotificationService: Object died trying to hide notification android.app.ITransientNotification$Stub$Proxy@746083e in package com.roswell108.pokemodex

08-13 12:57:58.176 808 808 W ActivityManager: setProcessForeground called on unknown pid: 4261

08-13 12:57:58.176 808 808 W NotificationService: Object died trying to show notification android.app.ITransientNotification$Stub$Proxy@d48969f in package com.roswell108.pokemodex

Indeed, after setting pokemodex as an allowed mock location application, it runs successfully and the PkGo buddy moves accordingly. However, with that Android setting PkGo does not work: it shows a warning message saying "Failed to detect location" (despite the buddy being where pokemodex tells it to be).