mapbox navigation android - fragment - failed to call observer method - mapbox

I created a small project to show the error I have on the MapBox Navigation library.
I would like to know if it comes from an element in the life cycle or the SDK used directly?
The difficulty lies in the fact that I would like the fragment to restart the navigation service at each arrival on it.
Link project:
https://github.com/gonzalt03/mapbox-navigation-android-fragment-test-app
02-05 16:17:47.353 24931-24931/com.company.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.company.myapplication, PID: 24931
java.lang.RuntimeException: Unable to resume activity {com.company.myapplication/com.company.myapplication.MainActivity}: java.lang.RuntimeException: Failed to call observer method
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3848)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3889)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6836)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.RuntimeException: Failed to call observer method
at android.arch.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:225)
at android.arch.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent(ClassesInfoCache.java:193)
at android.arch.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks(ClassesInfoCache.java:184)
at android.arch.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged(ReflectiveGenericLifecycleObserver.java:36)
at android.arch.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:353)
at android.arch.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:291)
at android.arch.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:331)
at android.arch.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:137)
at android.arch.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:123)
at android.arch.lifecycle.ReportFragment.dispatch(ReportFragment.java:121)
at android.arch.lifecycle.ReportFragment.onStart(ReportFragment.java:81)
at android.app.Fragment.performStart(Fragment.java:2378)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1027)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1153)
at android.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:2048)
at android.app.FragmentController.dispatchStart(FragmentController.java:188)
at android.app.Activity.performStart(Activity.java:6978)
at android.app.Activity.performRestart(Activity.java:7088)
at android.app.Activity.performResume(Activity.java:7093)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3825)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3889) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6836) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410) 
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayer.setLayerVisibility(LocationLayer.java:76)
at com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerPlugin.setLocationLayerEnabled(LocationLayerPlugin.java:139)
at com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerPlugin.onStart(LocationLayerPlugin.java:265)...

Related

Unable to start receiver com.google.android.finsky.instantapps.PhenotypeUpdateReceiver: java.lang.IllegalStateException

I have released my game to play console which is made using Unity. The Pre-launch report, reported the following crash issues during internal testing.
java.lang.RuntimeException: Unable to start receiver com.google.android.finsky.instantapps.PhenotypeUpdateReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.android.gms.phenotype.UPDATE cmp=com.android.vending/com.google.android.finsky.instantapps.PhenotypeUpdateService }: app is in background uid UidRecord{46dceb4 u0a249 TRNB bg:+10m41s432ms idle change:uncached procs:4 proclist:29801,29978,30388,30591, seq(0,0,0)}
AND
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
I am not sure, where exactly the error is and why?
Full trace for the first issue:
FATAL EXCEPTION: main
Process: com.android.vending:instant_app_installer, PID: 19323
java.lang.RuntimeException: Unable to start receiver com.google.android.finsky.instantapps.PhenotypeUpdateReceiver: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=com.google.android.gms.phenotype.UPDATE cmp=com.android.vending/com.google.android.finsky.instantapps.PhenotypeUpdateService }: app is in background uid UidRecord{64ad173 u0a135 TRNB bg:+13m22s373ms idle change:uncached procs:0 seq(0,0,0)}
at android.app.ActivityThread.handleReceiver(ActivityThread.java:4317)
at android.app.ActivityThread.access$1600(ActivityThread.java:247)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2064)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7839)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=com.google.android.gms.phenotype.UPDATE cmp=com.android.vending/com.google.android.finsky.instantapps.PhenotypeUpdateService }: app is in background uid UidRecord{64ad173 u0a135 TRNB bg:+13m22s373ms idle change:uncached procs:0 seq(0,0,0)}
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1861)
at android.app.ContextImpl.startService(ContextImpl.java:1817)
at android.content.ContextWrapper.startService(ContextWrapper.java:774)
at alj.a(PG:2)
at alm.a(PG:3)
at wnv.a(PG:2)
at com.google.android.finsky.instantapps.PhenotypeUpdateReceiver.onReceive(PG:6)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:4308)
... 9 more
Full trace for the second issue:
FATAL EXCEPTION: pool-3-thread-1
Process: com.HefazSofts.AayaanTheRunner, PID: 19257
java.lang.IllegalArgumentException: com.HefazSofts.AayaanTheRunner: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:174)
at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:108)
at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:86)
at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)

java.lang.RuntimeException: Unable to start activity ComponentInfo{apps.coolse.flutter_fingerprint_auth/apps.coolse.flutter

java.lang.RuntimeException: Unable to start activity ComponentInfo{apps.coolse.flutter_fingerprint_auth/apps.coolse.flutter_fingerprint_auth.MainActivity}: java.lang.IllegalStateException: ensureInitializationComplete must be called after startInitialization
E/AndroidRuntime(31529): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3479)

Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com.example.app.MainActivity}: java.lang.IllegalArgumentException:

My flutter application keeps on crashing and logging this error on firebase crash analytics
Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com.aims.covidsurvey/com.example.app.MainActivity}: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter activity
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4463)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4482)
at android.app.ActivityThread.-wrap6(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1640)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6617)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
Have tried to debug the app, am not getting much information what is causing the error, anyone know what could be causing this and how to fix it? Have tried to research am not getting much information
the Kotlin code generated by the app
package com.example.app
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
And another crash error
Caused by java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter activity
at com.lyokone.location.FlutterLocationService.setActivity(FlutterLocationService.kt)
at com.lyokone.location.LocationPlugin.deinitialize(LocationPlugin.java:121)
at com.lyokone.location.LocationPlugin.detachActivity(LocationPlugin.java:56)
at com.lyokone.location.LocationPlugin.onDetachedFromActivity(LocationPlugin.java:69)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.detachFromActivity(FlutterEngineConnectionRegistry.java:389)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:556)
at io.flutter.embedding.android.FlutterActivity.release(FlutterActivity.java:587)
at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:608)
at android.app.Activity.performDestroy(Activity.java:7136)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1158)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4450)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4482)
at android.app.ActivityThread.-wrap6(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1640)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6617)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
My solution was to change the component location to geolocator
https://pub.dev/packages/geolocator

Error building .apk archive with Google Cardboard VR

I'm trying to build my VR project using Unity 5.6 and Google Cardboard. I'm getting the following error
CommandInvokationFailure: Unable to convert classes into dex format.
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/mymac/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -
stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/vr/cardboard/DisplaySynchronizer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/vr/cardboard/FrameMonitor;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/vr/cardboard/NFCUtils;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/vr/cardboard/NFCUtils$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/vr/cardboard/TransitionView;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/vr/cardboard/TransitionView$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/vr/cardboard/TransitionView$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/vr/cardboard/TransitionView$3;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/vr/cardboard/TransitionView$TransitionListener;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:613)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at SDKMain.main(SDKMain.java:129)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:605)
... 9 more
]
stdout[
processing archive /Users/mymac/Desktop/project/Temp/StagingArea/android-libraries/gvr-permissionsupport-release/libs/./classes.jar...
processing com/google/gvr/permissionsupport/BuildConfig.class...
processing com/google/gvr/permissionsupport/PermissionsFragment.class...
processing com/google/gvr/permissionsupport/PermissionsFragment$1.class...
processing com/google/gvr/permissionsupport/PermissionsFragment$PermissionsCallback.class...
processing com/google/gvr/permissionsupport/TransitionVRActivity.class...
processing com/google/gvr/permissionsupport/TransitionVRActivity$1.class...
ignored resource mymac/Temp/StagingArea/android-libraries/gvr/libs/./armeabi-v7a/libgvr.so
processing archive
Looking around I found that it might be a .jar/.aar files duplication error, so I have looked for them in my project:
mymac$ find . | grep .aar
./Assets/Plugins/Android/gvr-permissionsupport-release.aar
./Assets/Plugins/Android/gvr-permissionsupport-release.aar.meta
./Temp/StagingArea/aar
./Temp/StagingArea/aar/gvr-permissionsupport-release.aar
./Temp/StagingArea/aar/gvr.aar
./Temp/StagingArea/aar/unitygvr.aar
mymac$ find . | grep .jar
./Assets/Plugins/Android/unityvractivity.jar
./Assets/Plugins/Android/unityvractivity.jar.meta
./Temp/StagingArea/android-libraries/gvr/libs/classes.jar
./Temp/StagingArea/android-libraries/gvr-permissionsupport-release/libs/classes.jar
./Temp/StagingArea/android-libraries/unitygvr/libs/classes.jar
./Temp/StagingArea/bin/classes.jar
./Temp/StagingArea/plugins/libprotobuf-java-nano.jar
./Temp/StagingArea/plugins/unityvractivity.jar
ad you can see there are no duplications as all the other files are copy created in /Temp at build time. Not sure about how to proceed.
Fixed removing the GoogleVR plug-in from the project. Somehow there was a duplication even if not shown by the bash console.

Parcel error in actionbarsherlock

I am getting a crash with below crash log..i cannot reproduce it ...anyone with the knowledge why its happening?
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.qz.XXXX/com.qz.XXXX.XXXXStartActivity}: java.lang.RuntimeException: Parcel android.os.Parcel#410839c0: Unmarshalling unknown type code -38 at offset 1124
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2351)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$600(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1331)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5485)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Parcel android.os.Parcel#410839c0: Unmarshalling unknown type code -38 at offset 1124
at android.os.Parcel.readValue(Parcel.java:2037)
at android.os.Parcel.readSparseArrayInternal(Parcel.java:2260)
at android.os.Parcel.readSparseArray(Parcel.java:1692)
at android.os.Parcel.readValue(Parcel.java:2027)
at android.os.Parcel.readMapInternal(Parcel.java:2231)
at android.os.Bundle.unparcel(Bundle.java:223)
at android.os.Bundle.getSparseParcelableArray(Bundle.java:1232)
at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1728)
at android.app.Activity.onRestoreInstanceState(Activity.java:957)
at com.actionbarsherlock.app.SherlockActivity.onRestoreInstanceState(SherlockActivity.java:127)
at android.app.Activity.performRestoreInstanceState(Activity.java:929)
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1162)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2329)
Steps to reproduce:
Enable developer option "Don't keep activities"
Run application
Start other package activity
Press back -> crash
I have fixed it this way:
#Override
protected void onSaveInstanceState(Bundle outState) {
//super.onSaveInstanceState(outState);
}
If you don't need to save an activity state, it is quite a good solution.