proyecto26 / react-native-inappbrowser

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

Android build breaks due to the release of `androidx.browser:browser:1.5.0-alpha01` on Oct. 24th #386

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.4.0" in your project android/build.gradle:

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

It already happened before

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

ghost commented 1 year ago

@proyecto26 any updates?

xseignard commented 1 year ago

I'm not sure @BrianCodeItUp solution is the best approach as you don't need to patch this lib to keep it working. Just edit your own android/build.gradle

I'd recommend relying on @BrianCodeItUp solution only in the context of expo managed workflow with expo go. If you have a custom dev client, you can also create your own expo-config-plugin to set the androidXBrowser version.

BrianCodeItUp commented 1 year ago

@xseignard Your solution is better. There is no need to patch this package in order to make it work. I will delete my comment to prevent people getting the wrong information.

stvrhm commented 1 year ago

How to fix?

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

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

This works, thank you 💪🏻

For those who wondering how to add this to your managed workflow expo app configuration, here's an example: Install expo-gradle-ext-vars with npx expo install expo-gradle-ext-vars. Then in your app.json, add the following lines to your plugins settings:

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