maxkomarychev / react-native-ultimate-config

Config that works
MIT License
260 stars 31 forks source link

Build Failure - RN 0.69.1 #107

Closed omniviewsports closed 1 year ago

omniviewsports commented 2 years ago

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.

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

Env file

Example of env file that is causing problems

âť—PROVIDE EXAMPLE OF ENV FILE

OS

Packages

Run react-native info and post below:

PASTE OUTPUT OF `react-native info` HERE

Additional context

Add any other context about the problem here.

mateusz1913 commented 2 years ago

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'

}
anrodrigues0 commented 2 years ago

i think i have the same problem, when I try to compile with version 69.1 of react native it gives me this error. :(

`* 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`
vinipachecov commented 2 years ago

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'

}

This works for me!

DartVadius commented 1 year ago

react-native 0.70.0 same issue

Sabaturdzeladze commented 1 year ago

The library does not work for the latest RN versions (> 69.0) on android (iOS seems fine)

Tohid1999 commented 1 year ago

Same with react-native 0.70.4

elliotdickison commented 1 year ago

@vagnerlandio Thanks! Unblocked me when migrating to react-native 0.70.5

marcshilling commented 1 year ago

@mateusz1913's solution above works for me and seems much simpler than @vagnerlandio's. What's the difference between these approaches and is either better or worse?

mateusz1913 commented 1 year ago

@marcshilling I provided only a workaround which disables some code regarding maven publishing. I didn't check whole @vagnerlandio solution, but it seems to be more complete solution. I don't have an idea which is better, as I didn't use that library for a longer time

vagnerlandio commented 1 year ago

@marcshilling I consider @mateusz1913 solution to be better, as it has fewer modifications and solves the problem.

Thinking about it, I will delete my solution, because it has many modifications, new bugs may appear.

HenryLee2703 commented 1 year ago

Have any solution without editing on node-modules like this? I have the same issue like this

HenryLee2703 commented 1 year ago

Have any solution without editing on node-modules like this? I have the same issue like this

Hi, anyone here?

vagnerlandio commented 1 year ago

Have any solution without editing on node-modules like this? I have the same issue like this

Hi, anyone here?

You can fork the project, edit the necessary file, commit and add the package to the project from the fork using yarn add https://github.com/HenryLee2703/react-native-ultimate-config

HenryLee2703 commented 1 year ago

Have any solution without editing on node-modules like this? I have the same issue like this

Hi, anyone here?

You can fork the project, edit the necessary file, commit and add the package to the project from the fork using yarn add https://github.com/HenryLee2703/react-native-ultimate-config

maybe it's a not good solution. I'm working in a project with a lot of people, they can depend on me and otherwise. Maybe the author of this library should have some adjusting on this library, he should update the library follow up by the latest version of react native. it's out of date

elliotdickison commented 1 year ago

@maxkomarychev Do you have thoughts on the patch from @mateusz1913? Would there be a way to merge a variation of that without breaking the Maven publishing process?

vagnerlandio commented 1 year ago

By the amount of unanswered messages in this and other opened issues, I presume that the author has paused development and maintenance of the package.

I have dozens of published applications that depend on this package so I created a fork of the project, renamed it and published it on npm as react-native-awesome-config (v4.1.1)

This new version has the following changes:

Obs: The project was renamed, but I kept the "rnuc" command for better compatibility.

maxkomarychev commented 1 year ago

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!

HenryLee2703 commented 1 year ago

By the amount of unanswered messages in this and other opened issues, I presume that the author has paused development and maintenance of the package.

I have dozens of published applications that depend on this package so I created a fork of the project, renamed it and published it on npm as react-native-awesome-config (v4.1.1)

This new version has the following changes:

  • package updated with support for version 0.71.0 of react-native.
  • example project updated to version 0.71.0 of react-native.
  • example-web project updated for version 18.2.0 of reactjs.
  • Fixes for build on ios
  • Fixes for build on android.
  • All tests pass 100% coverage
  • Dependencies updated to the latest stable versions.
  • Other small changes, nothing significant.

Obs: The project was renamed, but I kept the "rnuc" command for better compatibility.

Hi @vagnerlandio , how about react native version 0.70.6? Does the react-native-awesome-config support this version. I've init a project with many dependencies of version 0.70.6 . Thank you

vagnerlandio commented 1 year ago

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 for project!

would be great. And then I delete the version I pushed to npm

vagnerlandio commented 1 year ago

By the amount of unanswered messages in this and other opened issues, I presume that the author has paused development and maintenance of the package. I have dozens of published applications that depend on this package so I created a fork of the project, renamed it and published it on npm as react-native-awesome-config (v4.1.1) This new version has the following changes:

  • package updated with support for version 0.71.0 of react-native.
  • example project updated to version 0.71.0 of react-native.
  • example-web project updated for version 18.2.0 of reactjs.
  • Fixes for build on ios
  • Fixes for build on android.
  • All tests pass 100% coverage
  • Dependencies updated to the latest stable versions.
  • Other small changes, nothing significant.

Obs: The project was renamed, but I kept the "rnuc" command for better compatibility.

Hi @vagnerlandio , how about react native version 0.70.6? Does the react-native-awesome-config support this version. I've init a project with many dependencies of version 0.70.6 . Thank you

I tested only in versions 0.70.0, 0.70.1, 0.7.4 and 0.71.0. As it worked in the latest version so I believe it will also work in this version 0.70.6

maxkomarychev commented 1 year ago

@vagnerlandio could you please open a pr from the top of your master, I will allocate some time to review changes this week and figure out logistics related to collaboration in this repository and publishing new versions. thanks!

HenryLee2703 commented 1 year ago

@vagnerlandio could you please open a pr from the top of your master, I will allocate some time to review changes this week and figure out logistics related to collaboration in this repository and publishing new versions. thanks!

Thanks for your paying attention about our issues, u can review above answers to resolve the issues, hope u push a new version resolved issue asap

maxkomarychev commented 1 year ago

@HenryLee2703 is that the fix that is confirmed to work in this particular case https://github.com/maxkomarychev/react-native-ultimate-config/issues/107#issuecomment-1211395294 ?

HenryLee2703 commented 1 year ago

@HenryLee2703 is that the fix that is confirmed to work in this particular case #107 (comment) ?

What fixing do you mean?

vagnerlandio commented 1 year ago

@vagnerlandio could you please open a pr from the top of your master, I will allocate some time to review changes this week and figure out logistics related to collaboration in this repository and publishing new versions. thanks!

OK, by the end of the week I will do that, I will also do a review on the changes I made, although it works in react-native version 0.71.0 I found a problem in an app that uses an older version. I'll analyze further and then fix it if necessary. (maybe the problem is in my app and not in the package)

elliotdickison commented 1 year ago

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!

@maxkomarychev I'd be happy to help maintain - I can at least support the web functionality that I added awhile back. You've created by far the best RN config package out there and I'd love to see it live on.

vagnerlandio commented 1 year ago

@maxkomarychev I've opened the pull request #128 . Please review and let me know if there are any changes that need to be made before it can be merged.

@elliotdickison can you test the maven publishing process in this pull request? In my tests, gradle test, gradle build and gradle publish worked perfectly.

@HenryLee2703 You could also test if the #128 solves your related issue?

Thanks!

maxkomarychev commented 1 year ago

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!

maxkomarychev commented 1 year ago

@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!

maxkomarychev commented 1 year ago

Closing this for now.