reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
219 stars 328 forks source link

0.75.2版本的react-native跑不起来 #867

Open gaoxinxiao opened 2 months ago

gaoxinxiao commented 2 months ago

AILURE: Build failed with an exception.

BUILD FAILED in 17s error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':gradle-plugin:shared:compileKotlin'.

Could not resolve all files for configuration ':gradle-plugin:shared:compileClasspath'. > Could not resolve com.google.code.gson:gson:2.8.9. Required by: project :gradle-plugin:shared > Could not resolve com.google.code.gson:gson:2.8.9. > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.8.9/gson-2.8.9.pom'. > Could not GET 'https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.8.9/gson-2.8.9.pom'. > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. For more on this, please refer to https://docs.gradle.org/8.8/userguide/build_environment.html#sec:gradle_system_properties in the Gradle documentation. > Remote host terminated the handshake > Could not resolve com.google.guava:guava:31.0.1-jre. Required by: project :gradle-plugin:shared > Could not resolve com.google.guava:guava:31.0.1-jre. > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.pom'. > Could not GET 'https://repo.maven.apache.org/maven2/com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.pom'. > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. For more on this, please refer to https://docs.gradle.org/8.8/userguide/build_environment.html#sec:gradle_system_properties in the Gradle documentation. > Remote host terminated the handshake * 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. Get more help at https://help.gradle.org. BUILD FAILED in 17s. info Run CLI with --verbose flag for more details. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

sunnylqm commented 2 months ago

翻墙问题

gaoxinxiao commented 2 months ago

./gradlew generateAutolinkingPackageList

Task :app:generateAutolinkingPackageList FAILED

FAILURE: Build failed with an exception.

sunnylqm commented 2 months ago

官方确认的bug,会在0.75.3中修复(尚未发布)

这里有一个临时解决办法 https://github.com/facebook/react-native/issues/46134#issuecomment-2323674786

创建react-native.config.js文件,里面添加packageName

module.exports = {
  project: {
    ios: {},
    android: {
      packageName: 'com.awesomeproject',  // 你的项目的安卓包名
    },
  },
};