react-native-ultimate-config: Build Failure - RN 0.69.1

Describe the bug

Configure project :react-native-ultimate-config WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

FAILURE: Build failed with an exception.

  • Where: Build file ‘/Users/nikhilpatel/ovs-projects/Bitbucket/yourzone-frontend/node_modules/react-native-ultimate-config/android/build.gradle’ line: 113

  • What went wrong: A problem occurred configuring project ‘:react-native-ultimate-config’.

Could not resolve all files for configuration ‘:react-native-ultimate-config:implementation’. Could not resolve com.facebook.react:react-native:+. Required by: project :react-native-ultimate-config Cannot choose between the following variants of com.facebook.react:react-native:0.69.1: - debugVariantDefaultRuntimePublication - releaseVariantDefaultRuntimePublication All of them match the consumer attributes: - Variant ‘debugVariantDefaultRuntimePublication’ capability com.facebook.react:react-native:0.69.1: - Unmatched attributes: - Provides com.android.build.api.attributes.BuildTypeAttr ‘debug’ but the consumer didn’t ask for it - Provides org.gradle.category ‘library’ but the consumer didn’t ask for it - Provides org.gradle.dependency.bundling ‘external’ but the consumer didn’t ask for it - Provides org.gradle.libraryelements ‘aar’ but the consumer didn’t ask for it - Provides org.gradle.status ‘release’ but the consumer didn’t ask for it - Provides org.gradle.usage ‘java-runtime’ but the consumer didn’t ask for it - Variant ‘releaseVariantDefaultRuntimePublication’ capability com.facebook.react:react-native:0.69.1: - Unmatched attributes: - Provides com.android.build.api.attributes.BuildTypeAttr ‘release’ but the consumer didn’t ask for it - Provides org.gradle.category ‘library’ but the consumer didn’t ask for it - Provides org.gradle.dependency.bundling ‘external’ but the consumer didn’t ask for it - Provides org.gradle.libraryelements ‘aar’ but the consumer didn’t ask for it - Provides org.gradle.status ‘release’ but the consumer didn’t ask for it - Provides org.gradle.usage ‘java-runtime’ but the consumer didn’t ask for it

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

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.3.3/userguide/command_line_interface.html#sec:command_line_warnings

Steps to Reproduce

Steps to reproduce the behavior.

Build Android project using RN 0.69.1

Expected behavior

Project Builds successfully

Stacktraces, logs, screenshots

Post stacktraces, logs or screenshots. The more information is available is better.

Environment

See reactnative.dev for RN 0.69.1

Integration option

  • I am using rnuc CLI to inject environment (default integration option from quickstart guide)
  • I am using scheme/flavor based integration (experimental integration option from cookbook: scheme, flavors)
  • I am using react-native-ultimate-config within monorepo managed with Lerna or Yarn Workspaces Monorepo support

Env file

  • I am using dotenv file as a source for variables
  • I am using YAML file as a source for variables

Example of env file that is causing problems

❗PROVIDE EXAMPLE OF ENV FILE

OS

  • ios
  • android

Packages

  • version of react-native: ❗ INSERT VERSION HERE
  • version of react-native-ultimate-config: ❗INSERT VERSION HERE

Run react-native info and post below:

PASTE OUTPUT OF `react-native info` HERE

Additional context

Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 30 (16 by maintainers)

Most upvoted comments

I also encountered that issue, however that code seems to be related only to maven publishing. Workaround with patch-package:

task androidJavadoc(type: Javadoc) {
        source = android.sourceSets.main.java.srcDirs
        classpath += files(android.bootClasspath)
-        project.getConfigurations().implementation.setCanBeResolved(true)
-        classpath += files(project.getConfigurations().getByName('implementation').asList())
+        // https://github.com/maxkomarychev/react-native-ultimate-config/issues/107
+        // This is only for publishing to maven, so commenting it out does not affect app
+        // project.getConfigurations().implementation.setCanBeResolved(true)
+        // classpath += files(project.getConfigurations().getByName('implementation').asList())
        include '**/*.java'

}

@elliotdickison @vagnerlandio I value your contribution and willingness to support this project! I am figuring out logistics related to permissions & workflows when adding more people to the repository.

Stay tuned!

There was a massive refactoring made to the library and this problem could have been fixed in a new version 4.1.0-alpha.0 (https://github.com/maxkomarychev/react-native-ultimate-config/pull/128)

Please give it a try!! Thank you!

hey @vagnerlandio would you like opening a PR here and/or getting more permissions in the project to avoid fragmentation?

p.s. you are correct, I was not able to allocate enough time to keep up with all incoming issues and challenges and I’m willing to add more people to work on this project!