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

why not publish reactNative to Maven/Jcenter/Google? #33591

Closed
henryloveself opened this issue Apr 8, 2022 · 1 comment
Closed

why not publish reactNative to Maven/Jcenter/Google? #33591

henryloveself opened this issue Apr 8, 2022 · 1 comment
Labels
Resolution: Fixed A PR that fixes this issue has been merged.

Comments

@henryloveself
Copy link

Description

8: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeDebugNativeLibs'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.facebook.react:react-native:0.67.2.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/facebook/react/react-native/0.67.2/react-native-0.67.2.pom
- https://repo.maven.apache.org/maven2/com/facebook/react/react-native/0.67.2/react-native-0.67.2.pom
- https://jcenter.bintray.com/com/facebook/react/react-native/0.67.2/react-native-0.67.2.pom
Required by:
project :app

  • 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.
    ==============================================================================

Version

0.67.2

Output of npx react-native info

npx react-native info
warn Package cjs-module-lexer has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/hesheng/reactnative/MyTest/ReactNativeTest/node_modules/cjs-module-lexer/package.json
warn Package escalade has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/hesheng/reactnative/MyTest/ReactNativeTest/node_modules/escalade/package.json
warn Package get-package-type has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/hesheng/reactnative/MyTest/ReactNativeTest/node_modules/get-package-type/package.json
info Fetching system and libraries information...
System:
OS: macOS 12.3.1
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 81.89 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.15.4 - /usr/local/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 6.14.10 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7784292
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.14 - /Library/Java/JavaVirtualMachines/jdk-11.0.14.jdk/Contents/Home/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: ^17.0.2 => 17.0.2
react-native: ^0.67.2 => 0.67.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. Android studio- new project
  2. npm install --save react-native@0.67.2
  3. npm install --save react@17.0.2
  4. add app/build.gradle(implementation "com.facebook.react:react-native:0.67.2" //与node_modules下的rn版本号一致
    implementation "org.webkit:android-jsc:+")
  5. add build.gradle in project(maven {
    url "$rootDir/node_modules/react-native/android"
    }
    maven {
    // Android JSC is installed from npm
    url("$rootDir/node_modules/jsc-android/dist")
    })
  6. sync

Snack, code example, screenshot, or link to a repository

I checked release version in these links, found only maven center has release version(latest version is 0.20.1/), so why not publish react-native release version in those three lib center?

@cortinico
Copy link
Contributor

I checked release version in these links, found only maven center has release version(latest version is 0.20.1/), so why not publish react-native release version in those three lib center?

That's intended.
Currently com.facebook.react:react-native:+ should be consumed from the NPM package react-native. We added a directive to the build.gradle file to handle this specifically:

maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}

@cortinico cortinico added Resolution: Fixed A PR that fixes this issue has been merged. and removed Needs: Triage 🔍 labels Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Fixed A PR that fixes this issue has been merged.
Projects
None yet
Development

No branches or pull requests

2 participants