question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android app fails after update to Android 25.0.0

See original GitHub issue

Description

I updated the android appcompat library version to 25.0.0 because I wanted to use some APIs that were introduced in API level 24. After downloading and installing the required files, when I start the app on either device or Genymotion Simulator, it throws the below exception and the attached screenshot appears on the app screen. So, the app isn’t exactly crashed but I don’t see the app launch screen.

Exception:

10-27 13:45:08.550 7317-7317/com.galarmapp E/AndroidRuntime: FATAL EXCEPTION: main
                                                             Process: com.galarmapp, PID: 7317
                                                             android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@c51fa6 -- permission denied for this window type
                                                                 at android.view.ViewRootImpl.setView(ViewRootImpl.java:591)
                                                                 at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:310)
                                                                 at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
                                                                 at android.app.Dialog.show(Dialog.java:319)
                                                                 at com.facebook.react.devsupport.DevSupportManagerImpl.handleReloadJS(DevSupportManagerImpl.java:644)
                                                                 at com.facebook.react.XReactInstanceManagerImpl$3$1.run(XReactInstanceManagerImpl.java:401)
                                                                 at android.os.Handler.handleCallback(Handler.java:739)
                                                                 at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                 at android.os.Looper.loop(Looper.java:148)
                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Below screen shows up on the device and the Simulator

screen shot 2016-10-27 at 1 57 10 pm

By default, the Draw over other apps permissions is set to No for the app. On the device, if I enable the permission and restart the app, it works as expected. On the Simulator, it keeps showing the same screen. Is there a way to allow this permission by default because a user may not know that he has to enable the Draw over other apps permissions.

Reproduction

Update the android appcompat library version by updating the following the android/app/build.gradle file

buildToolsVersion "25.0.0 compile "com.android.support:appcompat-v7:25.0.0

Add following permissions to the AndroidManifest.xml file

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <uses-permission android:name="android.permission.READ_CONTACTS" />

Run the app and observe the specified behavior

Additional Information

  • React Native version: 0.34.1
  • Platform: Android
  • Operating System: MacOS

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
leeightcommented, Oct 27, 2016

Please set targetSdkVersion to 22. React Native has compatible issues with targetSdkVersion 23+.

0reactions
hramoscommented, Jul 21, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we’re automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix an installed Android app that isn't working
Try the following steps if an app installed on your phone has any of these problems: Crashing. Won't open. Won't respond. Isn't working...
Read more >
Error of 25.0.0 while compiling the project
just replace the facebook compile version ,Because in latest version Support lib is updated to the SDK version 25. compile 'com.facebook.android ...
Read more >
Recent Support Library Revisions
Bug fixes. Application crashes with support library 27 and downloadable font; Downloadable fonts not working for new projects created after updating SDK ...
Read more >
java.lang.IllegalArgumentException: Rect should intersect with ...
Since a recent update (this week), I very often get this exception: java.lang.IllegalArgumentException: Rect should intersect with child's bounds. at android.
Read more >
Firebase Android SDK Release Notes
Learn how to install these SDKs in your app: Add Firebase to your Android Project. ... The Kotlin extensions library has the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found