react-native-inappbrowser: Build failed. Error cannot find symbol builder.setNavigationBarColor
> Task :react-native-inappbrowser-reborn:compileReleaseJavaWithJavac FAILED
/Users/alexandrsmirnov/Work/E-Orda/Colibri-mobile/node_modules/react-native-inappbrowser-reborn/android/src/main/java/com/proyecto26/inappbrowser/RNInAppBrowser.java:107: error: cannot find symbol
builder.setNavigationBarColor(Color.parseColor(colorString));
^
symbol: method setNavigationBarColor(int)
location: variable builder of type Builder
/Users/alexandrsmirnov/Work/E-Orda/Colibri-mobile/node_modules/react-native-inappbrowser-reborn/android/src/main/java/com/proyecto26/inappbrowser/RNInAppBrowser.java:116: error: cannot find symbol
builder.setNavigationBarDividerColor(Color.parseColor(colorString));
^
symbol: method setNavigationBarDividerColor(int)
location: variable builder of type Builder
2 errors
Which platform(s) does your issue occur on?
- Android
Package.json
"react-native": "^0.64.2"
"react-native-inappbrowser-reborn": "^3.6.1"
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 7
- Comments: 42 (18 by maintainers)
Thanks for sharing! I found the issue here: https://github.com/mattop1709/agorgy/blob/main/android/build.gradle#L10
Try using recent versions of AndroidX libraries (androidx.browser:browser):
Let me know if you have any other questions 👍
Hey there - not to put too fine a point on it, but no time at all should be spent attempting to make things work with Android Support Libraries.
It’s been 2 years since AndroidX was released and Android Support was deprecated, while I empathize with the difficulty of upgrading in some cases and I certainly sympathized (past tense) which is obvious since I created the jetifier tool to help everyone, I am out of present-tense sympathy for the situation.
People need to update.
this is a fresh init project version 0.64.2…it went to error as soon as i npm install this library…here is the link of the sample project https://github.com/mattop1709/agorgy
Facing the same issue with React native 0.61.4. It was working fine 2 days ago.
I’m using the androidX
Any updates about this issue?
@naveenkirugulige hmm still not working for me 😦
@pramahaditamaputra-ralali Using this solved the issue for me:
so how about the update ? how to fix this issue ? i’m facing this issue on RN 0.61.5
Can someone restate for me what was the fix here? It sounds like upgrading
androidXfixed it for you, but I have a version that is the same version as above.i’ve run into your code (project example) and it’s similar to my previous react native version (0.63.3). In this version, the app is working fine and able to run…the build error happened after I upgrade to version 0.64.2…
i am using android API 29…let me know if u need further info…
For people well and truly stuck there’s always patch-package to hack in compatibility inside current versions or to hack in current fixes to old versions. I would spend no time on it vs investing the time in actually moving forward but if you’re stuck you’re stuck, so it’s worth mentioning.
@jdnichollsc i wake up and decide to give a try to fix this issue for these projects in Android Support xD
More details here: https://stackoverflow.com/a/62785094/1532821 And Jetifier tool: https://github.com/mikehardy/jetifier
okay, for those in the future:
To solve the problem with
setNavigationBarColor:Migrate your react-native android app from Android Support to AndroidX using this guide: https://developer.android.com/jetpack/androidx/migrate
Update you build script in build.gradle in app level with following:
To solve the problem above with
create_react_contextdo the following:in build.gradle of the project add:
And in your
AndroidManifest.xmladd:Hope it’s helps you. reference: https://stackoverflow.com/questions/55441230/unable-to-load-script-make-sure-you-are-either-running-a-metro-server-or-that-yo?page=2&tab=votes#tab-top
Good question, with Android Support I’m not sure if exist any option or conditional compilation flag to avoid this issue, let me check, any pull request is welcome in the meantime! ❤️
fyi: i’m trying to migrate my app to AndroidX…
Hey @jdnichollsc , i’m facing the same problem. How could I solve this problem for Android support?
Click here to see package.json
Click here to see build.gradle(project)
Click here to see build.gradle(app)
The codebase of my project i handle it have some legacy code from RN Below 0.60, i tried to follow some suggestion such as update my Android Studio to the lastest stable version 4.2.2 and update the SDK and the gradle also, and then tried to only use the Android Support or Android X settings in the build.gradle file but it still same not fix my issue, the terminal always shows the error same as this post. And the error happened because the library get update to 3.6.1 version and works well in Version 3.4.0 ~ 3.5.1
@jdnichollsc yup i know it maybe some of you have a better way to solve this issue, but in my case the new release version 3.6.1 give an error to my App built with React Native Version 0.65.1 and i try to downgrade it to 3.4.0 and its work ☺
Finally the issue has been solved, i changed the version number from this “react-native-inappbrowser-reborn”: “^3.4.0” to this one “react-native-inappbrowser-reborn”: “3.4.0” and its compatible with my current RN Version 0.61.5 ( removed this ^ symbol )
@jdnichollsc did you found the best way to solve this issue ?
yeah just to ensure everything is according to the setup instruction…btw, thanks!
yeah, luckily somebody point this up…having this issue with react native version 0.64…