proyecto26 / react-native-inappbrowser

📱InAppBrowser for React Native (Android & iOS) 🤘
https://www.npmjs.com/package/react-native-inappbrowser-reborn
MIT License
1.29k stars 218 forks source link

Android build breaks due to the release of androidx.browser:browser:1.6.0-beta01 on June 22th #423

Open xseignard opened 1 year ago

xseignard commented 1 year ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Build on android

How to fix?

Add a androidXBrowser = "1.5.0" in your project android/build.gradle:

buildscript {
    ext {
        // ...
        androidXBrowser = "1.5.0"

It already happened before

See this issue: https://github.com/proyecto26/react-native-inappbrowser/issues/386

See this issue: https://github.com/proyecto26/react-native-inappbrowser/issues/298

A more robust solution (e.g. fixed version instead of 1.+) would be great

It happens all the time...

SophieJung7 commented 1 year ago

Can you guys fix this asap? Don't want to change android/build.gradle file...:(

hbel commented 1 year ago

FYI, for those of you using Expo, I think I have found (a quite hacky) workaround to be able to at least build your android binaries locally again (without ejecting your whole project).

You can (of course) edit the gradle file as given in PR #424 to use version 1.5.0, locally, but since metro is running yarn install by itself when building with eas build --local, it will not be enough to make if you only do so in your local node_modules. You also have to change the file in yarn's cache directory, too. After that (and maybe clearing your gradle caches, too), you should be able to build again (until you clear yarn's cache, of course). At least, that worked for me.

xseignard commented 1 year ago

please don't use @hbel solution 😬

rely on a custom dev client (see: https://docs.expo.dev/develop/development-builds/introduction/)

and use a custom plugin to change androidXBrowser in the ext, you can have a look at this one https://github.com/transistorsoft/expo-gradle-ext-vars

hbel commented 1 year ago

I'm terribly sorry for causing that confusion. I actually tried to set the ext vars first, but seemed to have not cleared all the caches, so it did not work. I can confirm that this solution works - tried it in several projects.

HiveForensicsAI commented 12 months ago

I got it to work very simply it took me a few hours of trying different solutions but ultimately my solution was solved by adding the plugins to the app.json for my expo project also making sure to format it correctly and install vars this solution was recommended already previously so this is nothing new

"plugins": [ ["expo-gradle-ext-vars", { "androidXBrowser": "1.4.0" }] ] } }

krini commented 10 months ago

My app still crashes though I added androidXBrowser = "1.5.0" in android/build.gradle file. Do I need to do something else? I'm using "react-native-inappbrowser-reborn": "^3.7.0" "react-native": "0.71.13",

esbenvb commented 9 months ago

My app still crashes though I added androidXBrowser = "1.5.0" in android/build.gradle file. Do I need to do something else? I'm using "react-native-inappbrowser-reborn": "^3.7.0" "react-native": "0.71.13",

In android/app/build.gradle add this:

configurations.all {
   resolutionStrategy {
    force 'androidx.browser:browser:1.5.0'
   }
}
martinsotirov commented 8 months ago

I got it to work very simply it took me a few hours of trying different solutions but ultimately my solution was solved by adding the plugins to the app.json for my expo project also making sure to format it correctly and install vars this solution was recommended already previously so this is nothing new

"plugins": [ ["expo-gradle-ext-vars", { "androidXBrowser": "1.4.0" }] ] } }

This turned out to be the correct answer for our case.

jamesleeht commented 7 months ago

The current build seems to set the version as: androidx.browser:browser:1.8.0-alpha01.

expo-gradle-ext-vars solution does not seem to work as intended anymore.