Search code examples
androidmapbox-android

Performing the Location picker with- Fragment- Android -Mapbox


Hello i am "Location picker, I want to get location with. I did and it happened according to the link below.

mapbax github

https://github.com/prensmiskin/fff/blob/master/one

But I want to use the "Location picker" structure in a class extended by fragment. But I get an error.

The above code works, but I get an error when I make it in a class that is extent by fragment.

I get an error when I do as follows.

https://github.com/prensmiskin/fff/blob/master/two

Errors I Received

2020-03-18 18:41:13.790 1746-2323/? E/GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
2020-03-18 18:41:13.790 1746-2323/? E/GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
2020-03-18 18:41:13.817 1729-12128/? E/ResolverController: No valid NAT64 prefix (101, <unspecified>/0)
2020-03-18 18:41:13.827 12017-12017/com.one.qaroco D/skia: --- Failed to create image decoder with message 'unimplemented'
2020-03-18 18:41:13.828 12017-12017/com.one.qaroco E/Mbgl-MapChangeReceiver: Exception in onDidFinishLoadingStyle
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.Bitmap$Config android.graphics.Bitmap.getConfig()' on a null object reference
        at com.mapbox.mapboxsdk.maps.Style.toImage(Style.java:1026)
        at com.mapbox.mapboxsdk.maps.Style.addImage(Style.java:343)
        at com.mapbox.mapboxsdk.maps.Style.addImage(Style.java:317)
        at com.one.qaroco.Fragment_Seven.initDroppedMarker(Fragment_Seven.java:172)
        at com.one.qaroco.Fragment_Seven.access$300(Fragment_Seven.java:59)
        at com.one.qaroco.Fragment_Seven$1.onStyleLoaded(Fragment_Seven.java:114)
        at com.mapbox.mapboxsdk.maps.MapboxMap.notifyStyleLoaded(MapboxMap.java:891)
        at com.mapbox.mapboxsdk.maps.MapboxMap.onFinishLoadingStyle(MapboxMap.java:213)
        at com.mapbox.mapboxsdk.maps.MapView$MapCallback.onDidFinishLoadingStyle(MapView.java:1316)
        at com.mapbox.mapboxsdk.maps.MapChangeReceiver.onDidFinishLoadingStyle(MapChangeReceiver.java:198)
        at com.mapbox.mapboxsdk.maps.NativeMapView.onDidFinishLoadingStyle(NativeMapView.java:1068)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:336)
        at android.os.Looper.loop(Looper.java:174)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
2020-03-18 18:41:13.828 12017-12017/com.one.qaroco A/libc: /usr/local/google/buildbot/src/android/ndk-release-r20/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type jni::PendingJavaException" failed
2020-03-18 18:41:13.829 12017-12017/com.one.qaroco A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 12017 (com.one.qaroco), pid 12017 (com.one.qaroco)
2020-03-18 18:41:13.831 1746-2323/? E/GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
2020-03-18 18:41:13.831 1746-2323/? E/GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
2020-03-18 18:41:13.883 2004-2122/? W/AppOps: Noting op not finished: uid 10097 pkg com.google.android.gms code 79 time=1584546063803 duration=-1
2020-03-18 18:41:13.885 2004-2122/? W/AppOps: Noting op not finished: uid 10097 pkg com.google.android.gms code 79 time=1584546073883 duration=0
2020-03-18 18:41:13.944 2173-2442/? D/EGL_emulation: eglMakeCurrent: 0xdb91a720: ver 2 0 (tinfo 0xdb90fcb0)
2020-03-18 18:41:13.948 2173-2442/? I/chatty: uid=10104(com.android.systemui) RenderThread identical 1 line
2020-03-18 18:41:13.950 2173-2442/? D/EGL_emulation: eglMakeCurrent: 0xdb91a720: ver 2 0 (tinfo 0xdb90fcb0)
2020-03-18 18:41:13.954 12136-12136/? I/crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2020-03-18 18:41:13.957 1826-1826/? I//system/bin/tombstoned: received crash request for pid 12017
2020-03-18 18:41:13.964 12136-12136/? I/crash_dump32: performing dump of process 12017 (target tid = 12017)
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG: Build fingerprint: 'google/sdk_gphone_x86/generic_x86:10/QSR1.190920.001/5891938:user/release-keys'
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG: Revision: '0'
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG: ABI: 'x86'
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG: Timestamp: 2020-03-18 18:41:13+0300
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG: pid: 12017, tid: 12017, name: com.one.qaroco  >>> com.one.qaroco <<<
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG: uid: 10235
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG: signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG: Abort message: '/usr/local/google/buildbot/src/android/ndk-release-r20/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type jni::PendingJavaException" failed'
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG:     eax 00000000  ebx 00002ef1  ecx 00002ef1  edx 00000006
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG:     edi eb20533e  esi ffe95620
2020-03-18 18:41:13.971 12136-12136/? A/DEBUG:     ebp eef95ad0  esp ffe955c8  eip eef95ad9
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG: backtrace:
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #00 pc 00000ad9  [vdso] (__kernel_vsyscall+9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #01 pc 00092328  /apex/com.android.runtime/lib/bionic/libc.so (syscall+40) (BuildId: 76290498408016ad14f4b98c3ab6c65c)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #02 pc 000ad651  /apex/com.android.runtime/lib/bionic/libc.so (abort+193) (BuildId: 76290498408016ad14f4b98c3ab6c65c)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #03 pc 000adb88  /apex/com.android.runtime/lib/bionic/libc.so (__assert2+56) (BuildId: 76290498408016ad14f4b98c3ab6c65c)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #04 pc 00322f14  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #05 pc 00323094  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #06 pc 00320209  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #07 pc 0031f73e  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #08 pc 0031f693  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (__cxa_throw+115) (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #09 pc 0004b85d  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #10 pc 0004ee8b  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #11 pc 000531ee  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #12 pc 0005266e  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #13 pc 000bad44  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #14 pc 0011e335  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #15 pc 001206c4  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #16 pc 0005007f  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #17 pc 0017ed41  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #18 pc 0006e140  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #19 pc 0009f69c  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #20 pc 00051445  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #21 pc 0006db1a  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #22 pc 0006dc41  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #23 pc 0006c1c9  /data/app/com.one.qaroco-Fdlvfhys7ipi-25VYJdyBg==/lib/x86/libmapbox-gl.so (BuildId: e62ccc8211736b1e70efa24c9ab4adf3ef5c33b9)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #24 pc 00018487  /system/lib/libutils.so (android::SimpleLooperCallback::handleEvent(int, int, void*)+39) (BuildId: 288ba3aff5b46dbd7e74be954af88b83)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #25 pc 00019414  /system/lib/libutils.so (android::Looper::pollInner(int)+1044) (BuildId: 288ba3aff5b46dbd7e74be954af88b83)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #26 pc 00018f4e  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+62) (BuildId: 288ba3aff5b46dbd7e74be954af88b83)
2020-03-18 18:41:14.152 12136-12136/? A/DEBUG:       #27 pc 0013299b  /system/lib/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long long, int)+59) (BuildId: 6ceb9761bceb97a18c92f8a4b7072247)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #28 pc 002b86f8  /system/framework/x86/boot-framework.oat (art_jni_trampoline+136) (BuildId: ff6ec03dd8445d20788424c92ba8ea28ad0f54f4)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #29 pc 02004796  /memfd:/jit-cache (deleted) (android.os.MessageQueue.next+230)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #30 pc 0013e7d2  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+338) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #31 pc 00149a69  /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+281) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #32 pc 00332502  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+386) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #33 pc 0032c19c  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+988) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #34 pc 0068186d  /apex/com.android.runtime/lib/libart.so (MterpInvokeVirtual+989) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #35 pc 00138821  /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_virtual+33) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #36 pc 00319d8a  /system/framework/framework.jar (android.os.Looper.loop+130)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #37 pc 00684f6c  /apex/com.android.runtime/lib/libart.so (MterpInvokeStatic+1260) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #38 pc 001389a1  /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_static+33) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #39 pc 0018945e  /system/framework/framework.jar (android.app.ActivityThread.main+194)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #40 pc 002f8e0a  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.12194892193087984976+298) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #41 pc 002ffcc5  /apex/com.android.runtime/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+181) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #42 pc 0066fbd9  /apex/com.android.runtime/lib/libart.so (artQuickToInterpreterBridge+1209) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #43 pc 0014503d  /apex/com.android.runtime/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #44 pc 0013e9a2  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #45 pc 00149a7a  /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+298) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #46 pc 0055a513  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+99) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #47 pc 0055c32f  /apex/com.android.runtime/lib/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned int)+1327) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #48 pc 004c9153  /apex/com.android.runtime/lib/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+83) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #49 pc 000c6bf8  /system/framework/x86/boot.oat (art_jni_trampoline+168) (BuildId: 7913dbaef2e8d9971cb7619ef0d566987f8326a7)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #50 pc 0013e7d2  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+338) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #51 pc 00149a69  /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+281) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #52 pc 00332502  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+386) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #53 pc 0032c19c  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+988) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #54 pc 0068186d  /apex/com.android.runtime/lib/libart.so (MterpInvokeVirtual+989) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #55 pc 00138821  /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_virtual+33) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #56 pc 0034cd36  /system/framework/framework.jar (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #57 pc 002f8e0a  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.12194892193087984976+298) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #58 pc 002ffcc5  /apex/com.android.runtime/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+181) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #59 pc 0066fbd9  /apex/com.android.runtime/lib/libart.so (artQuickToInterpreterBridge+1209) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #60 pc 0014503d  /apex/com.android.runtime/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #61 pc 00998b08  /system/framework/x86/boot-framework.oat (com.android.internal.os.ZygoteInit.main+1816) (BuildId: ff6ec03dd8445d20788424c92ba8ea28ad0f54f4)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #62 pc 0013e9a2  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_static_stub+418) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #63 pc 00149a7a  /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+298) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.153 12136-12136/? A/DEBUG:       #64 pc 0055a513  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+99) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.154 12136-12136/? A/DEBUG:       #65 pc 0055a1ae  /apex/com.android.runtime/lib/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, char*)+430) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.154 12136-12136/? A/DEBUG:       #66 pc 004305cd  /apex/com.android.runtime/lib/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, char*)+893) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.154 12136-12136/? A/DEBUG:       #67 pc 003d93bf  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, char*, art::Primitive::Type, art::InvokeType)+2847) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.154 12136-12136/? A/DEBUG:       #68 pc 003c7509  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, char*)+73) (BuildId: 895645e5113da057f27d9b2ec11eb3bf)
2020-03-18 18:41:14.154 12136-12136/? A/DEBUG:       #69 pc 000b25fe  /system/lib/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+62) (BuildId: 6ceb9761bceb97a18c92f8a4b7072247)
2020-03-18 18:41:14.154 12136-12136/? A/DEBUG:       #70 pc 000b628a  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+794) (BuildId: 6ceb9761bceb97a18c92f8a4b7072247)
2020-03-18 18:41:14.154 12136-12136/? A/DEBUG:       #71 pc 00003632  /system/bin/app_process32 (main+1490) (BuildId: b7a60bc7d078521421fd5a8d201915ae)
2020-03-18 18:41:14.154 12136-12136/? A/DEBUG:       #72 pc 000898e8  /apex/com.android.runtime/lib/bionic/libc.so (__libc_init+120) (BuildId: 76290498408016ad14f4b98c3ab6c65c)
2020-03-18 18:41:14.203 2957-3034/? I/WorkerManager: dispose()`

detail

** 172. line -> loadedMapStyle.addImage("dropped-icon-image", BitmapFactory.decodeResource(

59.line -> public class Fragment_Seven extends Fragment implements PermissionsListener, OnMapReadyCallback { 114.line -> initDroppedMarker(style);

I tried everything but I couldn't find the cause and solution of the error. I would be glad if you help. Happy and Healthy Days.

Github Issues


Solution

  • I solved the problem.
    
    private void initDroppedMarker(@NonNull Style loadedMapStyle) {
        // Add the marker image to map
        loadedMapStyle.addImage("dropped-icon-image", BitmapFactory.decodeResource(
        getResources(), R.drawable.blue_marker));
        loadedMapStyle.addSource(new GeoJsonSource("dropped-marker-source-id"));
        loadedMapStyle.addLayer(new SymbolLayer(DROPPED_MARKER_LAYER_ID,
        "dropped-marker-source-id").withProperties(
        iconImage("dropped-icon-image"),
        visibility(NONE),
        iconAllowOverlap(true),
        iconIgnorePlacement(true)
        ));
        }
    

    The "getResources" method, which is also used in the "initDroppedMarker" method, is the method of the "AppCompatActivity" class. "GetResources" will not work if your class is extent with Fragment. For this we need to use "getActivity".

      private void initDroppedMarker(@NonNull Style loadedMapStyle) {
    // Add the marker image to map
            loadedMapStyle.addImage("dropped-icon-image", BitmapFactory.decodeResource(
                    getActivity().getResources(), R.drawable.common_full_open_on_phone));
            loadedMapStyle.addSource(new GeoJsonSource("dropped-marker-source-id"));
            loadedMapStyle.addLayer(new SymbolLayer(DROPPED_MARKER_LAYER_ID,
                    "dropped-marker-source-id").withProperties(
                    iconImage("dropped-icon-image"),
                    visibility(NONE),
                    iconAllowOverlap(true),
                    iconIgnorePlacement(true)
            ));
        }