My app crashes when I open the in-app developer menu. I don't know the exact name but below is menu upon opening which the app crashes.
Versions
Android: 8.0.0
React Native: 0.47.2
Error
android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W#388d962 -- permission denied for window type 2003
Adb Logs
09-18 17:45:29.358 6982 6982 E AndroidRuntime: FATAL EXCEPTION: main
09-18 17:45:29.358 6982 6982 E AndroidRuntime: Process: com.numu.app, PID: 6982
09-18 17:45:29.358 6982 6982 E AndroidRuntime: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W#388d962 -- permission denied for window type 2003
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl.setView(ViewRootImpl.java:815)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:356)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.app.Dialog.show(Dialog.java:330)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at com.facebook.react.devsupport.DevSupportManagerImpl.showDevOptionsDialog(DevSupportManagerImpl.java:482)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at com.facebook.react.ReactInstanceManager.showDevOptionsDialog(ReactInstanceManager.java:663)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at com.facebook.react.ReactActivityDelegate.onKeyUp(ReactActivityDelegate.java:166)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at com.facebook.react.ReactActivity.onKeyUp(ReactActivity.java:82)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.KeyEvent.dispatch(KeyEvent.java:2712)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.app.Activity.dispatchKeyEvent(Activity.java:3280)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:352)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4768)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4640)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4175)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4228)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4194)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4321)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4202)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4378)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4175)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4228)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4194)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4202)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4175)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4228)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4194)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4354)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4515)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2465)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2028)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2019)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2442)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.os.MessageQueue.nativePollOnce(Native Method)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.os.MessageQueue.next(MessageQueue.java:325)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.os.Looper.loop(Looper.java:142)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6798)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
09-18 17:45:29.358 6982 6982 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
09-18 17:45:29.374 4106 9992 W ActivityManager: Force finishing activity com.numu.app/.MainActivity
09-18 17:45:29.494 536 9478 E vendor.qti.bluetooth#1.0-wake_lock: Release wakelock is released
09-18 17:45:29.877 4106 4199 W ActivityManager: Activity pause timeout for ActivityRecord{ffed9d5 u0 com.numu.app/.MainActivity t3548 f}
09-18 17:45:29.882 560 560 E ANDR-PERF-MPCTL: hint lookup failed
09-18 17:45:29.926 4106 4199 W BroadcastQueue: Background execution not allowed: receiving Intent { act=org.codeaurora.action.stk.idle_screen flg=0x10 (has extras) } to com.android.stk/.StkCmdReceiver
09-18 17:45:30.485 5966 6232 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
09-18 17:45:30.485 5966 6232 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
09-18 17:45:40.410 4106 4199 W ActivityManager: Activity destroy timeout for ActivityRecord{ffed9d5 u0 com.numu.app/.MainActivity t3548 f}
I get these logs by running: adb logcat app-name *:W.
I have seen that this issue mostly occurs on Oreo devices with RN version 48 or greater. There are multiple solutions online that include adding native Java code. But I can't understand them properly and none of them have worked for me so far. Below are some links I have followed;
android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W#c745883 - permission denied
Android: Unable to add window. Permission denied for this window type
Quoting a Github answer here:
https://github.com/facebook/react-native/issues/4043
I found a workaround here: http://stackoverflow.com/questions/32061934/permission-from-manifest-doesnt-work-in-android-6
add this to your MainActivity and call it in your onCreate or something. It will show a screen where you can activate the permission.
private static final int OVERLAY_PERMISSION_REQUEST_CODE = 2;
#TargetApi(Build.VERSION_CODES.M)
private void _askForOverlayPermission() {
if (!BuildConfig.DEBUG || android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return;
}
if (!Settings.canDrawOverlays(this)) {
Intent settingsIntent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + getPackageName()));
startActivityForResult(settingsIntent, OVERLAY_PERMISSION_REQUEST_CODE);
}
}
There is probably a way of implementing the dev menu that doesn't need this SystemAlertWindow though.
Related
I'm developing a custom version of AOSP for a particular device, but when I install certain apps like DuckDuckGo, Instagram, Whatsapp, etc the apps crash with ParcelFormatException. Other apps work fine. The android version I'm using is Android 8.1.1 (SDK 27).
After some research, I found that this might be related to cryptography/encryption. The device I'm working on currently uses Full Disk Encryption.
Logs attached
DuckDuckGo
09-02 06:04:46.146 9216 9216 E AndroidRuntime: FATAL EXCEPTION: main
09-02 06:04:46.146 9216 9216 E AndroidRuntime: Process: com.duckduckgo.mobile.android, PID: 9216
09-02 06:04:46.146 9216 9216 E AndroidRuntime: java.lang.RuntimeException: Unable to create application com.duckduckgo.app.global.DuckDuckGoApplication: android.os.ParcelFormatException: Bad tag: 0 at 180
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5758)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.app.ActivityThread.-wrap1(Unknown Source:0)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6518)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: Caused by: android.os.ParcelFormatException: Bad tag: 0 at 180
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.security.keymaster.KeymasterArgument$1.createFromParcel(KeymasterArgument.java:56)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.security.keymaster.KeymasterArgument$1.createFromParcel(KeymasterArgument.java:35)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.os.Parcel.createTypedArrayList(Parcel.java:2471)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.security.keymaster.KeymasterArguments.<init>(KeymasterArguments.java:61)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.security.keymaster.KeymasterArguments.<init>(Unknown Source:0)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.security.keymaster.KeymasterArguments$1.createFromParcel(KeymasterArguments.java:47)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.security.keymaster.KeymasterArguments$1.createFromParcel(KeymasterArguments.java:45)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.security.keymaster.KeyCharacteristics.readFromParcel(KeyCharacteristics.java:66)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.security.IKeystoreService$Stub$Proxy.generateKey(IKeystoreService.java:1151)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.security.KeyStore.generateKey(KeyStore.java:434)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi.engineGenerateKey(AndroidKeyStoreKeyGeneratorSpi.java:313)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at javax.crypto.KeyGenerator.generateKey(KeyGenerator.java:604)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at androidx.security.crypto.MasterKeys.generateKey(MasterKeys.java:142)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at androidx.security.crypto.MasterKeys.getOrCreate(MasterKeys.java:97)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at androidx.security.crypto.MasterKey$Builder.buildOnM(MasterKey.java:357)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at androidx.security.crypto.MasterKey$Builder.build(MasterKey.java:314)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.email.db.EmailEncryptedSharedPreferences.encryptedPreferences(EmailDataStore.kt:67)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.email.db.EmailEncryptedSharedPreferences.<init>(EmailDataStore.kt:55)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.email.di.EmailModule.providesEmailDataStore(EmailModule.kt:63)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.email.di.EmailModule_ProvidesEmailDataStoreFactory.providesEmailDataStore(EmailModule_ProvidesEmailDataStoreFactory.java:49)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.email.di.EmailModule_ProvidesEmailDataStoreFactory.get(EmailModule_ProvidesEmailDataStoreFactory.java:38)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.email.di.EmailModule_ProvidesEmailDataStoreFactory.get(EmailModule_ProvidesEmailDataStoreFactory.java:13)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.email.di.EmailModule_ProvidesEmailManagerFactory.get(EmailModule_ProvidesEmailManagerFactory.java:43)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.email.di.EmailModule_ProvidesEmailManagerFactory.get(EmailModule_ProvidesEmailManagerFactory.java:14)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.email.waitlist.AppConfigurationWorkerInjectorPlugin_Factory.get(AppConfigurationWorkerInjectorPlugin_Factory.java:37)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.email.waitlist.AppConfigurationWorkerInjectorPlugin_Factory.get(AppConfigurationWorkerInjectorPlugin_Factory.java:11)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.SetFactory.get(SetFactory.java:126)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.SetFactory.get(SetFactory.java:37)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.global.plugins.worker.WorkerInjectorPluginPoint_Factory.get(WorkerInjectorPluginPoint_Factory.java:23)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.global.plugins.worker.WorkerInjectorPluginPoint_Factory.get(WorkerInjectorPluginPoint_Factory.java:9)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.WorkerModule_WorkerFactoryFactory.get(WorkerModule_WorkerFactoryFactory.java:29)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.WorkerModule_WorkerFactoryFactory.get(WorkerModule_WorkerFactoryFactory.java:11)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.WorkerModule_WorkManagerFactory.get(WorkerModule_WorkManagerFactory.java:33)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.WorkerModule_WorkManagerFactory.get(WorkerModule_WorkManagerFactory.java:12)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.PrivacyModule_AutomaticDataClearerFactory.get(PrivacyModule_AutomaticDataClearerFactory.java:49)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.PrivacyModule_AutomaticDataClearerFactory.get(PrivacyModule_AutomaticDataClearerFactory.java:15)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.PrivacyModule_DataClearerLifecycleObserverFactory.get(PrivacyModule_DataClearerLifecycleObserverFactory.java:29)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.PrivacyModule_DataClearerLifecycleObserverFactory.get(PrivacyModule_DataClearerLifecycleObserverFactory.java:11)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.SetFactory.get(SetFactory.java:126)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.SetFactory.get(SetFactory.java:37)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.global.plugin.LifecycleObserverPluginPoint_Factory.get(LifecycleObserverPluginPoint_Factory.java:24)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.global.plugin.LifecycleObserverPluginPoint_Factory.get(LifecycleObserverPluginPoint_Factory.java:10)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.DaggerAppComponent.injectDuckDuckGoApplication(DaggerAppComponent.java:2229)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.DaggerAppComponent.inject(DaggerAppComponent.java:1959)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.di.DaggerAppComponent.inject(DaggerAppComponent.java:569)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.global.DuckDuckGoApplication.configureDependencyInjection(DuckDuckGoApplication.kt:130)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at com.duckduckgo.app.global.DuckDuckGoApplication.onCreate(DuckDuckGoApplication.kt:84)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1120)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5755)
09-02 06:04:46.146 9216 9216 E AndroidRuntime: ... 8 more
09-02 06:04:49.146 9235 9235 I AndroidRuntime: VM exiting with result code 0, cleanup skipped.
Instagram
09-02 05:46:57.528 7995 7995 E AndroidRuntime: FATAL EXCEPTION: main
09-02 05:46:57.528 7995 7995 E AndroidRuntime: Process: com.instagram.android, PID: 7995
09-02 05:46:57.528 7995 7995 E AndroidRuntime: java.lang.RuntimeException: Unable to create application com.instagram.app.InstagramAppShell: android.os.ParcelFormatException: Bad tag: 0 at 180
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5758)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.app.ActivityThread.-wrap1(Unknown Source:0)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6518)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: Caused by: android.os.ParcelFormatException: Bad tag: 0 at 180
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.security.keymaster.KeymasterArgument$1.createFromParcel(KeymasterArgument.java:56)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.security.keymaster.KeymasterArgument$1.createFromParcel(KeymasterArgument.java:35)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.os.Parcel.createTypedArrayList(Parcel.java:2471)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.security.keymaster.KeymasterArguments.<init>(KeymasterArguments.java:61)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.security.keymaster.KeymasterArguments.<init>(Unknown Source:0)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.security.keymaster.KeymasterArguments$1.createFromParcel(KeymasterArguments.java:47)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.security.keymaster.KeymasterArguments$1.createFromParcel(KeymasterArguments.java:45)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.security.keymaster.KeyCharacteristics.readFromParcel(KeyCharacteristics.java:66)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.security.IKeystoreService$Stub$Proxy.generateKey(IKeystoreService.java:1151)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.security.KeyStore.generateKey(KeyStore.java:434)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi.engineGenerateKey(AndroidKeyStoreKeyGeneratorSpi.java:313)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at javax.crypto.KeyGenerator.generateKey(KeyGenerator.java:604)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.10z.A00(:69)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.10H.A00(:71)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.10X.<init>(:138)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.10U.A6h(:8)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.10R.A00(:26)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.8O7.get(:9)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.0Vd.Anh(:11)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.15U.A00(:7)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.05u.Awr(:6)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.1Kb.A00(:161)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.05u.AaR(:0)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.0Za.get(:28)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.0Vd.Anh(:11)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.0ZZ.A01(:41)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.0em.A03(:18)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.0em.A2q(:2)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at X.0o0.A03(:214)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at com.instagram.process.instagram.InstagramApplicationForMainProcess.onCreate(:56155)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at com.instagram.app.InstagramAppShell.onCreate(:1311)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1120)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5755)
09-02 05:46:57.528 7995 7995 E AndroidRuntime: ... 8 more
09-02 05:53:12.964 3612 3612 D AndroidRuntime: Shutting down VM
Been stuck on this for a couple of days now. Any help would be much appreciated. Thank you
I'm building a Unity bridge for garmin android sdk. I'm trying to pair with the garmin device. On the first trial it asks for a passcode and connects successfully. If I relaunch the application and try to pair again this exception is thrown:
11-21 19:33:07.640 9601 9601 E AndroidRuntime: FATAL EXCEPTION: main
11-21 19:33:07.640 9601 9601 E AndroidRuntime: Process: com.rikkir.moodie, PID: 9601
11-21 19:33:07.640 9601 9601 E AndroidRuntime: java.lang.Error: FATAL EXCEPTION [main]
11-21 19:33:07.640 9601 9601 E AndroidRuntime: Unity version : 2018.2.6f1
11-21 19:33:07.640 9601 9601 E AndroidRuntime: Device model : BLU Dash X2
11-21 19:33:07.640 9601 9601 E AndroidRuntime: Device fingerprint: BLU/Dash_X2/Dash_X2:6.0/MRA58K/1477454813:user/release-keys
11-21 19:33:07.640 9601 9601 E AndroidRuntime:
11-21 19:33:07.640 9601 9601 E AndroidRuntime: Caused by: java.lang.IllegalStateException: vívosport[A1:A1:A1:A1:A1:A1] is already paired
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at com.garmin.health.awv.a(SourceFile:113)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at com.garmin.health.DeviceManager.pair(SourceFile:61)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at com.garmin.garminhealthbridge.PairingDialogFragment.onAttach(PairingDialogFragment.java:76)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at android.app.Fragment.onAttach(Fragment.java:1391)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:937)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1153)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at android.app.BackStackRecord.run(BackStackRecord.java:800)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1562)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at android.app.FragmentManagerImpl$1.run(FragmentManager.java:487)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:815)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:104)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at android.os.Looper.loop(Looper.java:207)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5728)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
11-21 19:33:07.640 9601 9601 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
11-21 19:33:07.644 813 2707 W ActivityManager: Force finishing activity com.rikkir.moodie/com.unity3d.player.UnityPlayerActivity
This is how I check if already paired:
//if already paired, call the "success" callback rightaway
if(DeviceManager.getDeviceManager().getGcmPairedDevices().contains(scannedDevice)) {
UnityPlayer.UnitySendMessage("GarminSDK", "PairingSucceeded", deviceAddress);
return;
}
else if(DeviceManager.getDeviceManager().getPairedDevices().contains(scannedDevice)) {
UnityPlayer.UnitySendMessage("GarminSDK", "PairingSucceeded", deviceAddress);
return;
}
After these checks, this is how I try to pair:
DeviceManager.getDeviceManager().pair(mDevice, new DevicePairingCallback());
And it crashes. Obviously, I'm not properly checking if the device is already paired. The documentation is scarce. Any help?
I am having a NoClassDefFoundError exception when I added Firebase analytics on my game that is built with gradle so I tried it on this demo app of firebase(https://github.com/firebase/quickstart-unity) and got the same error but with different class. All I did was just change the build settings to gradle, I didnt change any gradle configuration.
My version of unity is 5.6.3f1.
I am using firebase_unity_sdk_5.2.1 plugin.
This is the error from the Analytics Quickstart demo:
09-02 16:21:42.621 2968 2968 E AndroidRuntime: FATAL EXCEPTION: main
09-02 16:21:42.621 2968 2968 E AndroidRuntime: Process: com.DefaultCompany.DefaultProject, PID: 2968
09-02 16:21:42.621 2968 2968 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/measurement/AppMeasurement;
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.analytics.connector.AnalyticsConnectorImpl.getInstance(Unknown Source:23)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.analytics.connector.internal.zzb.create(Unknown Source:8)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.components.zzh.zza(com.google.firebase:firebase-common##16.0.1:29)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.components.zzi.get(Unknown Source:4)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.components.zzh.get(com.google.firebase:firebase-common##16.0.1:40)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.components.ComponentContainer$$CC.get(com.google.firebase:firebase-common##16.0.1:15)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.components.zzd.get(Unknown Source:0)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.components.zzd.zza(com.google.firebase:firebase-common##16.0.1:68)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.FirebaseApp.zze(com.google.firebase:firebase-common##16.0.1:716)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##16.0.1:329)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##16.0.1:295)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##16.0.1:282)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common##16.0.1:37)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at android.content.ContentProvider.attachInfo(ContentProvider.java:1925)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at android.content.ContentProvider.attachInfo(ContentProvider.java:1900)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common##16.0.1:31)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6578)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:6133)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6043)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at android.app.ActivityThread.-wrap1(Unknown Source:0)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:105)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6944)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurement" on path: DexPathList[[zip file "/data/app/com.DefaultCompany.DefaultProject-KmqojsTcbAmAFIe0mAe1NA==/base.apk"],nativeLibraryDirectories=[/data/app/com.DefaultCompany.DefaultProject-KmqojsTcbAmAFIe0mAe1NA==/lib/arm, /data/app/com.DefaultCompany.DefaultProject-KmqojsTcbAmAFIe0mAe1NA==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-02 16:21:42.621 2968 2968 E AndroidRuntime: ... 27 more
This is from my game:
09-02 15:12:24.259 29752 29752 E AndroidRuntime: FATAL EXCEPTION: main
09-02 15:12:24.259 29752 29752 E AndroidRuntime: Process: com.DefaultCompany.DefaultProject, PID: 29752
09-02 15:12:24.259 29752 29752 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/Preconditions;
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common##16.0.1:1050)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:6578)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:6133)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6043)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at android.app.ActivityThread.-wrap1(Unknown Source:0)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:105)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6944)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.Preconditions" on path: DexPathList[[zip file "/data/app/com.DefaultCompany.DefaultProject-5mnEepmltZFu956Rz8DGDQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.DefaultCompany.DefaultProject-5mnEepmltZFu956Rz8DGDQ==/lib/arm, /data/app/com.DefaultCompany.DefaultProject-5mnEepmltZFu956Rz8DGDQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-02 15:12:24.259 29752 29752 E AndroidRuntime: ... 12 more
Thank you for the help!
Setup wizard is getting crashed after the "set up as a new " screen when we connect to wifi it says:
checking for updates
and then Setup wizard crashes.
Android version: 7.1.2 GMS vesrion integrated in device:[7.1_r5]
We already have the framework changes added in our code but still we are getting the error
https://android.googlesource.com/platform/frameworks/base/+/b3ad567%5E%21/#F1
Logs:
09-19 17:39:19.360 9982 9982 E AndroidRuntime: FATAL EXCEPTION: main
09-19 17:39:19.360 9982 9982 E AndroidRuntime: Process: com.google.android.setupwizard, PID: 9982
09-19 17:39:19.360 9982 9982 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.google.android.setupwizard/com.google.android.setupwizard.account.AccountSetupWrapper}: **java.lang.SecurityException: Permission Denial: updateLockTaskPackages() from pid=9982, uid=10028 requires android.permission.UPDATE_LOCK_TASK_PACKAGES**
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityThread.-wrap12(ActivityThread.java)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6121)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: Caused by: java.lang.SecurityException: Permission Denial: updateLockTaskPackages() from pid=9982, uid=10028 requires android.permission.UPDATE_LOCK_TASK_PACKAGES
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1684)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1637)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at android.app.ActivityManagerProxy.updateLockTaskPackages(ActivityManagerNative.java:6774)
09-19 17:39:19.360 9982 9982 E AndroidRuntime: at
I am not sure exactly the reason why this happens, maybe your OpenGMS is not properly installed...
The setupwizard is install under "/system/priv-app", so you might change the permission level of android.permission.UPDATE_LOCK_TASK_PACKAGES in frameworks/base/core/res/AndroidManifest.xml as followings
android:protectionLevel="signature|setup|privileged"
This works in my case....
Able to fix the issue.
There seems to be a two setupwizard which are causing the issue
Add below piece of code in Android.mk for Setupwizard delivered as GMS application
LOCAL_OVERRIDES_PACKAGES := Provision Setup_Wizard
My NDK game works well in Debug mode, but crashes in release with the following log on Nexus 7:
E dalvikvm: dlopen("/data/app-lib/com.js.pathoflight-1/libPathOfLight.so") failed: dlopen failed: cannot locate symbol "__gnu_thumb1_case_uqi" referenced by
"libPathOfLight.so"...
W dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/js /pathoflight/JSNativeActivity;
W dalvikvm: Class init failed in newInstance call (Lcom/js/pathoflight/JSNativeActivity;)
D AndroidRuntime: Shutting down VM
W dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41b01700)
E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__gnu_thumb1_case_uqi" referenced by "libPathOfLight.so"...
E AndroidRuntime: at java.lang.Runtime.loadLibrary(Runtime.java:361)
E AndroidRuntime: at java.lang.System.loadLibrary(System.java:525)
E AndroidRuntime: at com.js.pathoflight.JSNativeActivity.<clinit>(JSNativeActivity.java:59)
E AndroidRuntime: at java.lang.Class.newInstanceImpl(Native Method)
E AndroidRuntime: at java.lang.Class.newInstance(Class.java:1130)
E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
E AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:141)
E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
E AndroidRuntime: at android.os.Looper.loop(Looper.java:137)
E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5103)
E AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:525)
E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
W ActivityManager: Force finishing activity com.js.pathoflight/.JSNativeActivity
I'll appreciate any suggestion.
While removing different parts of the code I found that the issue was in a 3rd party library I used.
I changed its usage from "gnustl_static" version (.a) to "gnustl_shared" (.so) one and the problem disappeared!