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

跟着官网教程运行报错 #769

Closed
XIAOLIU68 opened this issue Nov 8, 2023 · 7 comments
Closed

跟着官网教程运行报错 #769

XIAOLIU68 opened this issue Nov 8, 2023 · 7 comments

Comments

@XIAOLIU68
Copy link

npx react-native run-android
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.

info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'AwesomeProject'.

Could not determine the dependencies of null.
Could not resolve all task dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:.
Required by:
project :
> Could not resolve com.facebook.react:react-native-gradle-plugin.
Required by:
project :
> No matching variant of project :gradle-plugin was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.0.1' but:
- Variant 'apiElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Variant 'mainSourceElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a component, and its dependencies declared externally:
- Incompatible because this component declares a component of category 'verification' and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Doesn't say anything about its usage (required runtime)
- Variant 'runtimeElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Variant 'testResultsElementsForTest' capability com.facebook.react:react-native-gradle-plugin:unspecified:
- Incompatible because this component declares a component of category 'verification' and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
- Doesn't say anything about its target Java version (required compatibility with Java 8)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.0.1')
- Doesn't say anything about its usage (required runtime)

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

BUILD FAILED in 2s
error Failed to install the app. 请问这是哪里出现了问题

@sunnylqm
Copy link

sunnylqm commented Nov 8, 2023

jdk版本问题

@XIAOLIU68
Copy link
Author

jdk版本问题

你好,我是JDK javac 1.8.0_202版本 官网描述1.8版本即可 为什么我的还是不行,能麻烦解答一下吗,,我新手,感谢!

@sunnylqm
Copy link

sunnylqm commented Nov 8, 2023

rn什么版本 (能按提问模板来提问吗,能一次多提供些信息吗,新手不是我问一句你挤一句的理由吧?)

@MrAccelerator
Copy link

我也是一模一样的问题,0.72版本的rn,请问解决了吗?

@sunnylqm
Copy link

0.72版本需要jdk11

@MrAccelerator
Copy link

0.72版本需要jdk11

我用的就是jdk11版本呀

@sunnylqm
Copy link

那怎么叫一模一样的问题?不会另开个贴按模板描述吗?

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

3 participants