Skip to content
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

androidx.browser:browser updated to 1.9.0-alpha01 breaking the build and CI #475

Open
yard2010 opened this issue Jan 30, 2025 · 1 comment

Comments

@yard2010
Copy link

Hello, thank you for maintaining this marvelous project!

Since yesterday my build is failing with:

> Task :app:mergeExtDexDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5/userguide/command_line_interface.html#sec:command_line_warnings
665 actionable tasks: 17 executed, 648 up-to-date
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
ERROR:/Users/me/.gradle/caches/transforms-3/1caee3843997b3cdeea9f17ff87e57b9/transformed/browser-1.9.0-alpha01-runtime.jar: D8: java.lang.NullPointerException

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform browser-1.9.0-alpha01.aar (androidx.browser:browser:1.9.0-alpha01) to match attributes {artifactType=android-dex, asm-transformed-variant=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=24, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: /Users/me/.gradle/caches/transforms-3/1caee3843997b3cdeea9f17ff87e57b9/transformed/browser-1.9.0-alpha01-runtime.jar.
         > Error while dexing.

Going down the rabbit hole, I discovered that androidx:browser released a new version yesterday: 1.9.0-alpha01. It seems like it's incompatible with my ancient gradle/JDK.

Running ./gradlew app:dependencies | grep browser shows that this project is using 1.+ as the version of androidx.browser which made gradle update to 1.9.0-alpha01 breaking the build:

+--- project :react-native-inappbrowser-reborn
|    \--- androidx.browser:browser:1.+ -> 1.9.0-alpha01

Adding this to gradle.build solves the issue:

    configurations.all {
        resolutionStrategy {
            force 'androidx.browser:browser:1.8.0'
      }
    }

Maybe you should provide a more specific version, or lock this dependency, according to the docs:

Using dynamic dependency versions (e.g., 1.+ or [1.0,2.0)) can cause builds to break unexpectedly because the exact version of a dependency that gets resolved can change over time

My experience with Android is limited, so take everything I say with a grain of salt. If there's anyway I can contribute please let me know.

@noway
Copy link

noway commented Jan 30, 2025

@yard2010 great investigative work!

Interestingly enough, develop branch already has a change which would have prevented this failure mode. It uses 1.4.+ instead of 1.+ to require androidx.browser:browser:

def defaultAndroidXBrowserVersion = "1.4.+"

Problem is, there hasn't been a release recently and the latest version 3.7.0 doesn't include this change.

@jdnichollsc I know open source maintenance is a tough endeavour and you must have other priorities. Are there any releases planned soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants