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

Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available. #35845

Closed
yanel777 opened this issue Jan 16, 2023 · 26 comments
Labels
Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library Type: Upgrade Issue Issues reported from upgrade issue form

Comments

@yanel777
Copy link

yanel777 commented Jan 16, 2023

New Version

0.71.0, 0.71.0-rc.3 (tried both)

Old Version

0.68.5

Build Target(s)

android development debug

Output of react-native info

System:
OS: macOS 12.6
CPU: (10) arm64 Apple M1 Pro
Memory: 129.95 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.10.0 - /opt/homebrew/bin/node
Yarn: Not Found
npm: 8.19.2 - /opt/homebrew/bin/npm
Watchman: 2022.10.03.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 28, 29, 30, 31, 32, 33
Build Tools: 28.0.3, 30.0.2, 31.0.0, 32.0.0, 32.1.0, 33.0.0, 33.0.1
System Images: android-30 | Google Play ARM 64 v8a, android-33 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9014738
Xcode: 14.1/14B5033e - /usr/bin/xcodebuild
Languages:
Java: 11.0.16.1 - /opt/homebrew/opt/openjdk@11/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.0-rc.3 => 0.71.0-rc.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Issue and Reproduction Steps

./gradlew installDevelopmentDebug

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':react-native-linear-gradient:compileDebugAidl'.

Could not resolve all task dependencies for configuration ':react-native-linear-gradient:debugCompileClasspath'.
Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available.

this error fail for all libraries

@yanel777 yanel777 added Needs: Triage 🔍 Type: Upgrade Issue Issues reported from upgrade issue form labels Jan 16, 2023
@cortinico
Copy link
Contributor

react-native: 0.71.0-rc.3 => 0.71.0-rc.3

You say you're on 0.71.0 but your environment info says you're on 0.71.0-rc.3
Can you please confirm on which version are you?
Plus can you provide a reproducer of this bug?

@cortinico cortinico added Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. and removed Needs: Triage 🔍 labels Jan 19, 2023
@github-actions
Copy link

⚠️ Missing Reproducible Example
ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

@robinlindhout
Copy link

We have the same issue

@yanel777
Copy link
Author

react-native: 0.71.0-rc.3 => 0.71.0-rc.3

You say you're on 0.71.0 but your environment info says you're on 0.71.0-rc.3 Can you please confirm on which version are you? Plus can you provide a reproducer of this bug?

sorry. same issue on 0.71.0 and 0.71.0-rc.3
I have tried both

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jan 20, 2023
@cortinico cortinico added Needs: Author Feedback and removed Needs: Attention Issues where the author has responded to feedback. labels Jan 20, 2023
@cortinico
Copy link
Contributor

I'm looking for a repro at this stage as I can't help further

@jguipi
Copy link

jguipi commented Jan 23, 2023

same issues on my side

@indyteo
Copy link

indyteo commented Feb 4, 2023

Hello,
I ran into the same issue after upgrading to RN 0.71 and I found a workaround that worked for me:

  • Open android/app/build.gradle BE CAREFUL IT'S NOT android/build.gradle!!!
  • Add apply plugin: "com.facebook.react" like this:
 apply plugin: "com.android.application"
+apply plugin: "com.facebook.react"

 import com.android.build.OutputFile
 ...
  • Rebuild your application, it should works

However, this warning (shown when building) makes me feel this will break soon...

##############################

Using react.gradle in your project is deprecated! You should move to "apply plugin: com.facebook.react"
react.gradle is going to be removed in a future React Native project and your project will not build anymore.
You can use the template as a reference:
https://github.com/facebook/react-native/blob/main/template/android/app/build.gradle

##############################

Maybe we can completely replace the android/app/build.gradle file by this one, I didn't tested it because...

@cortinico
Copy link
Contributor

However, this warning (shown when building) makes me feel this will break soon...

The warning is there because you're still importing react.gradle which you should not.
If you follow the upgrade helper you'll see that you have to use apply plugin: com.facebook.react

@dmg46664
Copy link

@cortinico I'm hitting a similar issue although probably not the same (message slightly different).
However my question applies to both. Is there a way of getting the build to expand out what the dependency graph can see and the places it does check? Surely that would mean individuals can help narrow the problem themselves in the future?

@dmg46664
Copy link

I found a thread to pull on at least. I think this hint should be in the error message as it isn't obvious:
https://stackoverflow.com/questions/42596358/how-to-enable-stacktrace-react-native-run-android-command

@cortinico
Copy link
Contributor

@cortinico I'm hitting a similar issue although probably not the same (message slightly different).

@dmg46664 then please open a separate issue, share a reproducer and your environment. This issue is pending feedback from @yanel777. You can get an overview of your dependency tree if you run cd android && ./gradlew :app:assembleDebug --scan and check the Gradle Scan that gets produced.

@Danushka96
Copy link

https://react-native-community.github.io/upgrade-helper/?from=0.68.5&to=0.71.0

Update the package.json and app/build.gradle file according to the changes

@Mmferry
Copy link

Mmferry commented Mar 15, 2023

I have same error with react native v0.69.6

@github-actions
Copy link

github-actions bot commented Apr 8, 2023

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 8, 2023
@DeVoresyah
Copy link

I also facing same issue, but for my case I think it's because this library react-native-mmkv-storage

Error:

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find any matches for com.facebook.react:react-android:+ as no versions of com.facebook.react:react-android are available.
     Searched in the following locations:
       - file:/Users/cryptokun/Documents/react-native/MuloApp/node_modules/react-native/android/com/facebook/react/react-android/maven-metadata.xml
       - file:/Users/cryptokun/Documents/react-native/MuloApp/node_modules/jsc-android/dist/com/facebook/react/react-android/maven-metadata.xml
       - https://dl.google.com/dl/android/maven2/com/facebook/react/react-android/maven-metadata.xml
       - https://www.jitpack.io/com/facebook/react/react-android/maven-metadata.xml
     Required by:
         project :app > project :react-native-mmkv-storage

@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 10, 2023
@cortinico cortinico removed the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Apr 11, 2023
@cortinico
Copy link
Contributor

I also facing same issue, but for my case I think it's because this library react-native-mmkv-storage

Closing as this kind of issues are related to specific libraries. You can find which library is causing the issue in the error message like here:

 Required by:
    project :app > project :react-native-mmkv-storage

Please re-open if you believe this is a bug in React Native core.

@cortinico cortinico added Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library and removed Needs: Author Feedback labels Apr 11, 2023
@AkhileshManda
Copy link

@DeVoresyah I am facing the same issue, did you end up finding up a solution?

@DeVoresyah
Copy link

@DeVoresyah I am facing the same issue, did you end up finding up a solution?

yes by upgrading the react-native version into 0.71.6

@franznkemaka
Copy link

I also facing same issue, but for my case I think it's because this library react-native-mmkv-storage

Error:

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find any matches for com.facebook.react:react-android:+ as no versions of com.facebook.react:react-android are available.
     Searched in the following locations:
       - file:/Users/cryptokun/Documents/react-native/MuloApp/node_modules/react-native/android/com/facebook/react/react-android/maven-metadata.xml
       - file:/Users/cryptokun/Documents/react-native/MuloApp/node_modules/jsc-android/dist/com/facebook/react/react-android/maven-metadata.xml
       - https://dl.google.com/dl/android/maven2/com/facebook/react/react-android/maven-metadata.xml
       - https://www.jitpack.io/com/facebook/react/react-android/maven-metadata.xml
     Required by:
         project :app > project :react-native-mmkv-storage

I just faced the same issues,

it turns out React Native MMKV Storage > 2.5.1 isn't compatible with React Native below 0.71

Checkout the breaking changes: https://github.com/mrousavy/react-native-mmkv/releases

@fatemehmarzoughi
Copy link

fatemehmarzoughi commented May 17, 2023

I have also faced the same problem
react-native: 0.71.8
and I have added apply plugin: "com.facebook.react" to app/build.gradle
and getting this error:

* What went wrong:
A problem occurred evaluating project ':app'.
> Plugin with id 'com.facebook.react' not found.

I appreciate any help 🙏

@hanafnafs
Copy link

I have also faced the same problem react-native: 0.71.8 and I have added apply plugin: "com.facebook.react" to app/build.gradle and getting this error:

* What went wrong:
A problem occurred evaluating project ':app'.
> Plugin with id 'com.facebook.react' not found.

I appreciate any help 🙏

Same happened with me, any updates regarding this?

@delki8
Copy link

delki8 commented May 20, 2023

I'm upgrading from react-native 0.70.0 to 0.71.0.

First I was getting a Could not get unknown property 'hermesEnabled' for project ':app' of type org.gradle.api.Project.
which was 'fixed' adding hermesEnabled=true to gradle.properties.

Then I started seeing the Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available.
to fix it I added the plugin: "com.facebook.react" to app/build.gradle

What I'm now seeing is this > Plugin with id 'com.facebook.react' not found. which I'm not sure how to fix.

@flyskywhy
Copy link
Contributor

My RN 0.64.3 APP fixed it ref to https://stackoverflow.com/a/76521278/6318705

@omri81
Copy link

omri81 commented Oct 4, 2023

I'm upgrading from react-native 0.70.0 to 0.71.0.

First I was getting a Could not get unknown property 'hermesEnabled' for project ':app' of type org.gradle.api.Project. which was 'fixed' adding hermesEnabled=true to gradle.properties.

Then I started seeing the Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available. to fix it I added the plugin: "com.facebook.react" to app/build.gradle

What I'm now seeing is this > Plugin with id 'com.facebook.react' not found. which I'm not sure how to fix.

found any solution for this? facing the same issue

@delki8
Copy link

delki8 commented Oct 4, 2023

@omri81 try this: #36234 (comment). Not sure if that was my solution but it's the closest I can get to whatever worked for me.

@nabilfreeman
Copy link

I had this error, and it was because I screwed up my gradle config.

I did this:

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")

            // I pasted some stuff here
        }
    }
}

Instead of:

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // I should have pasted it here in a separate maven { block
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library Type: Upgrade Issue Issues reported from upgrade issue form
Projects
None yet
Development

No branches or pull requests