-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.62.0 Android API level 16 broken: Flipper #28481
Comments
|
Hello, @hramos I don't know if I can set the android version on Expo, so I didn't try to make a reproducible example on it. |
I am facing the same issue... |
We experienced KitKat devices not being able to connect via HTTPS since April 1st 2020 without any app updates. |
Same here. "Solved" by disabling Flipper (commenting out all related code) |
Please elaborate how to do that. Newbie here :) |
On app/build.gradle comment out: Delete or comment out all the code in android/app/src/debug/.../ReactNativeFlipper.java In MainApplication.java comment out: Idk if its overkill but it worked for me. |
Thanks. Currently I have reverted back to 0.61.5 but will definitely try out your solution. :) |
If solution given by @juanamd works, I believe the only problem is with flipper. And we all know "adb reverse" does works only with Android version 5.0 and above maybe flipper has to do something with it. I believe flipper should automatically disable itself when working with android version below 5.0. |
Happens for me on Android 10 after integrating Flipper into my app (upgraded from RN 60.4) |
Maybe related #9043 (comment) |
So, after messing around with gradle and looking at the dependencies of a bare React Native project, the culprit is Flipper with an explicit dependency on okhttp 3.14.1 which will not function on Android API < 21, the last working version being 3.12.1 which is the version React Native is dependent on. I fixed it in our projects by excluding okhttp from the debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
} Looking at facebook/flipper#1037, it looks like it's not something the Flipper team will change, so if the React Native team is willing to continue supporting older version of android ( |
@Shywim just ran into this and as a mostly-android-native developer your solution looks right. This looks like a group policy problem between the flipper and react-native teams where they have different minimum APIs to support. That's fine as far as it goes but not if the default init template from react-native crashes on devices that are supposed to be supported. You should propose the PR to the react-native template for consideration with a comment in the change indicating when it can be removed (minSdkVersion >= 21) - if you don't I will but the internet points are there for the taking :-) (I will note that okhttp 3.12.12 works fine on android API16 and above - I use it another app that still has tens of thousands of users on those old devices. It's the 3.12.x branch that is important, not 3.12.1 specifically in my experience) |
I fixed same problem by excluding okhttp in build file. It stop crashing.
But I'm getting this error (Mentioned in photo). also when I run react-native run-android, I'm getting this adb error also
Here is my environment.
|
Summary: This fixes #28481. As explained in [this comment](#28481 (comment)), the flipper network plugin pulls a more recent version of okhttp (3.14), but only versions of okhttp up to 3.12 works on Android API 21 and less. This prevented being able to run the app in debug mode, it was still working fine in release mode. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Fixed] - Fix unable to run in debug mode on Android API < 21 Pull Request resolved: #29260 Test Plan: Using `yarn react-native run-android` the app would instantly crash with this error in `adb logcat`: ``` E/AndroidRuntime( 5079): java.lang.RuntimeException: Unable to create application com.awesometsproject.MainApplication: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4154) E/AndroidRuntime( 5079): at android.app.ActivityThread.access$1300(ActivityThread.java:130) E/AndroidRuntime( 5079): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255) E/AndroidRuntime( 5079): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 5079): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime( 5079): at android.app.ActivityThread.main(ActivityThread.java:4745) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Method.invoke(Method.java:511) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) E/AndroidRuntime( 5079): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) E/AndroidRuntime( 5079): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 5079): Caused by: java.lang.RuntimeException: Requested enabled DevSupportManager, but DevSupportManagerImpl class was not found or could not be created E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:90) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManager.<init>(ReactInstanceManager.java:238) E/AndroidRuntime( 5079): at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:281) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:87) E/AndroidRuntime( 5079): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:39) E/AndroidRuntime( 5079): at com.awesometsproject.MainApplication.onCreate(MainApplication.java:47) E/AndroidRuntime( 5079): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999) E/AndroidRuntime( 5079): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4151) E/AndroidRuntime( 5079): ... 10 more E/AndroidRuntime( 5079): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime( 5079): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerFactory.create(DevSupportManagerFactory.java:80) E/AndroidRuntime( 5079): ... 17 more E/AndroidRuntime( 5079): Caused by: java.lang.NoClassDefFoundError: java.util.Objects E/AndroidRuntime( 5079): at okhttp3.CertificatePinner.withCertificateChainCleaner(CertificatePinner.java:231) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient.<init>(OkHttpClient.java:238) E/AndroidRuntime( 5079): at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevServerHelper.<init>(DevServerHelper.java:132) E/AndroidRuntime( 5079): at com.facebook.react.devsupport.DevSupportManagerImpl.<init>(DevSupportManagerImpl.java:183) E/AndroidRuntime( 5079): ... 20 more W/ActivityManager( 1456): Force finishing activity com.awesometsproject/.MainActivity ``` With this fix, the app launch successfully in debug mode, without having to remove flipper altogether from our config. Reviewed By: passy Differential Revision: D22521109 Pulled By: mdvacca fbshipit-source-id: 3c0263642438bd7c0d09b045e15a933bd8a26734
which file to edit? |
…dency. Part of the RN v0.62 -> v0.63 changes to the template app [1], corresponding to facebook/react-native@a642c3f26. This seems appropriate to do right away; a comment [2] on the corresponding RN issue links (as "the culprit") to a line in v0.33.1 of Flipper [3]. We're on v0.39.0, so it seems like it's time for us to take this fix. The consequence of not making this change is reported to be an inability to develop/debug with Android API < 21. There are no effects in production. [1] https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.4 [2] facebook/react-native#28481 (comment) [3] https://github.com/facebook/flipper/blob/v0.33.1/build.gradle#L89
…dency. Part of the RN v0.62 -> v0.63 changes to the template app [1], corresponding to facebook/react-native@a642c3f26. This seems appropriate to do right away; a comment [2] on the corresponding RN issue links (as "the culprit") to a line in v0.33.1 of Flipper [3]. We're on v0.39.0, so it seems like it's time for us to take this fix. The consequence of not making this change is reported to be an inability to develop/debug with Android API < 21. There are reportedly no effects in production. [1] https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.4 [2] facebook/react-native#28481 (comment) [3] https://github.com/facebook/flipper/blob/v0.33.1/build.gradle#L89
I have the below setup on
|
I looking for this solution. It's works well. Thanks!!! |
This worked for me. |
Description
When I run a new react native v0.62.0 Android app, it broken
React Native version:
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
npx react-native init AwesomeProject
yarn react-native run-android
adb logcat | grep 'AndroidRuntime'
)Note: If I comment the source Flipper source, the error disappears when the specific dependency is commented
Expected Results
App starts in Android API 16
Snack, code example, screenshot, or link to a repository:
Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.
You may provide a screenshot of the application if you think it is relevant to your bug report.
Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve
The text was updated successfully, but these errors were encountered: