Closed AlexSmirnov9107 closed 3 years ago
Any updates about this issue?
yeah, luckily somebody point this up..having this issue with react native version 0.64...
Please update Android Gradle, any pull request is welcome! π
Sorry guys, are you using Android Support instead of AndroidX? π€
Sorry guys, are you using Android Support instead of AndroidX? π€
I'm using the androidX
Please update Android Gradle, any pull request is welcome! π
these are the details of gradle which I use currently
android/build.gradle
dependencies { classpath("com.android.tools.build:gradle:4.1.0") classpath("com.google.gms:google-services:4.3.3") classpath("com.huawei.agconnect:agcp:1.4.0.300") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }
android/gradle/wrapper/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists
What Android versions are you testing? Can you try example project of this repository? Please let me know π
Happy week! β€οΈ
What Android versions are you testing? Can you try example project of this repository? Please let me know π
Happy week! β€οΈ
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...
Do you have this configuration? https://github.com/facebook/react-native/issues/25787#issuecomment-557486720 Can you attach a project to be able to reproduce this issue?
Thanks for your collaboration! π
Facing the same issue with React native 0.61.4. It was working fine 2 days ago.
Do you have this configuration? facebook/react-native#25787 (comment) Can you attach a project to be able to reproduce this issue?
Thanks for your collaboration! π
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
I just updated example project to the RN version 0.64.2, working as expected in my machine https://github.com/proyecto26/react-native-inappbrowser/tree/develop/example
Can you try updating your Android Studio/SDK? We added new configuration required to support Android 11 :)
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
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):
androidXAnnotation = "1.+"
androidXBrowser = "1.+"
Let me know if you have any other questions π
Oh and on the other hand, with Autolinking you don't need to install this package manually :) https://github.com/mattop1709/agorgy/blob/main/android/app/build.gradle#L188
implementation project(':react-native-inappbrowser-reborn')
Happy coding! <3
Oh and on the other hand, with Autolinking you don't need to install this package manually :) https://github.com/mattop1709/agorgy/blob/main/android/app/build.gradle#L188
implementation project(':react-native-inappbrowser-reborn')
Happy coding! <3
yeah just to ensure everything is according to the setup instruction...btw, thanks!
Can someone restate for me what was the fix here? It sounds like upgrading androidX
fixed it for you, but I have a version that is the same version as above.
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
androidXAnnotation = "1.1.0"
androidXBrowser = "1.0.0"
supportLibVersion = "28.0.0"
}
Can someone restate for me what was the fix here? It sounds like upgrading
androidX
fixed it for you, but I have a version that is the same version as above.buildscript { ext { buildToolsVersion = "29.0.2" minSdkVersion = 21 compileSdkVersion = 29 targetSdkVersion = 29 androidXAnnotation = "1.1.0" androidXBrowser = "1.0.0" supportLibVersion = "28.0.0" }
In your example you're not using the same versions and also you're still using Android support (supportLibVersion) instead of AndroidX
so how about the update ? how to fix this issue ? i'm facing this issue on RN 0.61.5
@pramahaditamaputra-ralali Using this solved the issue for me:
buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
ndkVersion = "20.1.5948944"
androidXAnnotation = "1.+"
androidXBrowser = "1.+"
}
}
@naveenkirugulige hmm still not working for me :(
@jdnichollsc did you found the best way to solve this issue ?
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 )
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 )
That's not true, this plugin supports old versions of RN, you need to learn more about Android π
@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 βΊ
Are you using Android Support or AndroidX?
PD: You're going to need the fixes we have in the last version π
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
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
You need to attach a repository to be able to reproduce your issue, I can't help you with the same logs π
Hey @jdnichollsc , i'm facing the same problem. How could I solve this problem for Android support?
fyi: i'm trying to migrate my app to AndroidX...
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! β€οΈ
the error of this issue was gone but i get stuck in app run attempt:
FATAL EXCEPTION: create_react_context
Process: com.dialogy.shop.list, PID: 21384
java.lang.RuntimeException: Unable to load script. Make sure you're either running Metro (run 'react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.
at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:234)
at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:29)
at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:263)
at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1293)
at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:131)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1023)
at java.lang.Thread.run(Thread.java:923)
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:
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
ndkVersion = "20.1.5948944"
androidXAnnotation = "1.+"
androidXBrowser = "1.+"
}
dependencies {
classpath("com.android.tools.build:gradle:4.0.1") <-- I've downgraded for 4.0.1
}
To solve the problem above with create_react_context
do the following:
in build.gradle of the project add:
...
project.ext.react = [
enableHermes: false, // clean and rebuild if changing
bundleAssetName: "index.android.bundle", <-- add this
bundleInDebug: true, <-- add this
bundleInRelease: true <-- add this
]
...
And in your AndroidManifest.xml
add:
...
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:usesCleartextTraffic="true" <-- add this
android:theme="@style/AppTheme">
...
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
More details here: https://stackoverflow.com/a/62785094/1532821 And Jetifier tool: https://github.com/mikehardy/jetifier
@jdnichollsc i wake up and decide to give a try to fix this issue for these projects in Android Support xD
@mikehardy hello mate, hope you're doing well
Do you know if exist any option to solve this error for projects in Android Support? I can't see any compilation flag to detect if AndroidX
is supported or something like that for Android backwards compatibility, thanks in advance! <3
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.
Ok, the only option I found is using Reflection, e.g:
final int color = Color.parseColor(colorString);
Method setNavigationBarColor = builder.getClass().getDeclaredMethod("setNavigationBarColor", int.class);
setNavigationBarColor.invoke(builder, color);
I'm going to create a new release with this solution <3
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.
@mikehardy thanks for your comments! I really appreciate your time and help! <3
@reberthkss what do you think? https://github.com/proyecto26/react-native-inappbrowser/pull/281
It was fixed in v3.6.2! Thanks @reberthkss for your help! <3
Which platform(s) does your issue occur on?
Package.json