我试图在本地构建一个Expo React Native应用程序,以便在Android模拟器上进行测试,因为我使用的react-native-auth 0不支持Expo Go。然而,当我尝试构建时,我得到了这个错误:
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred configuring root project 'FIRST2'.
[RUN_GRADLEW] > Could not determine the dependencies of null.
[RUN_GRADLEW] > Could not resolve all task dependencies for configuration ':classpath'.
[RUN_GRADLEW] > Could not resolve expo.modules:expo-dev-launcher-gradle-plugin.
[RUN_GRADLEW] Required by:
[RUN_GRADLEW] project :
[RUN_GRADLEW] > No matching variant of project :expo-dev-launcher-gradle-plugin
[RUN_GRADLEW] was found. The consumer was configured to find
[RUN_GRADLEW] a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.4.2'
[RUN_GRADLEW] but:
[RUN_GRADLEW] - Variant 'apiElements' capability expo.modules:expo-dev-launcher-gradle-plugin:unspecified declares
[RUN_GRADLEW] a library, packaged as a jar, and its dependencies declared externally:
[RUN_GRADLEW] - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed
[RUN_GRADLEW] a runtime of a component compatible with Java 8
[RUN_GRADLEW] - Other compatible attribute:
[RUN_GRADLEW] - Doesn't say anything about
[RUN_GRADLEW] org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Variant 'mainSourceElements' capability expo.modules:expo-dev-launcher-gradle-plugin:unspecified declares a component, and its dependencies declared externally:
[RUN_GRADLEW] - Incompatible because this component declares
[RUN_GRADLEW] a component of category 'verification' and the consumer needed
[RUN_GRADLEW] a library
[RUN_GRADLEW] - Other compatible attributes:
[RUN_GRADLEW] - Doesn't say anything about
[RUN_GRADLEW] its target Java version (required compatibility with Java 8)
[RUN_GRADLEW] - Doesn't say anything about
[RUN_GRADLEW] its elements (required them packaged as a jar)
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Doesn't say anything about its usage (required a runtime)
[RUN_GRADLEW] - Variant 'runtimeElements' capability expo.modules:expo-dev-launcher-gradle-plugin:unspecified declares
[RUN_GRADLEW] a runtime of a library, packaged as a jar, and its dependencies declared externally:
[RUN_GRADLEW] - Incompatible because this component declares a component compatible with Java 11 and the consumer needed
[RUN_GRADLEW] a component compatible with Java 8
[RUN_GRADLEW] - Other compatible attribute:
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Variant 'testResultsElementsForTest' capability expo.modules:expo-dev-launcher-gradle-plugin:unspecified:
[RUN_GRADLEW] - Incompatible because this component declares a component of category 'verification' and the consumer needed a library
[RUN_GRADLEW] - Other compatible attributes:
[RUN_GRADLEW] - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
[RUN_GRADLEW] - Doesn't say anything about its target Java version (required compatibility with Java 8)
[RUN_GRADLEW] - Doesn't say anything about its elements (required them packaged as a jar)
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Doesn't say anything about its usage (required a runtime)
[RUN_GRADLEW] > Could not resolve com.android.tools.build:gradle:7.4.2.
[RUN_GRADLEW] Required by:
[RUN_GRADLEW] project :
[RUN_GRADLEW] > No matching variant of com.android.tools.build:gradle:7.4.2
[RUN_GRADLEW] was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.4.2' but:
[RUN_GRADLEW] - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:
[RUN_GRADLEW] - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
[RUN_GRADLEW] - Other compatible attribute:
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
[RUN_GRADLEW] - Incompatible because this component declares documentation and the consumer needed a library
[RUN_GRADLEW] - Other compatible attributes:
[RUN_GRADLEW] - Doesn't say anything about its target Java version (required compatibility with Java 8)
[RUN_GRADLEW] - Doesn't say anything about its elements (required them packaged as a jar)
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
[RUN_GRADLEW] - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
[RUN_GRADLEW] - Other compatible attribute:
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
[RUN_GRADLEW] - Incompatible because this component declares documentation and the consumer needed a library
[RUN_GRADLEW] - Other compatible attributes:
[RUN_GRADLEW] - Doesn't say anything about its target Java version (required compatibility with Java 8)
[RUN_GRADLEW] - Doesn't say anything about its elements (required them packaged as a jar)
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] > Could not resolve com.facebook.react:react-native-gradle-plugin.
[RUN_GRADLEW] Required by:
[RUN_GRADLEW] project :
[RUN_GRADLEW] > No matching variant of project :gradle-plugin was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.4.2' but:
[RUN_GRADLEW] - Variant 'apiElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a library, packaged as a jar, and its dependencies declared externally:
[RUN_GRADLEW] - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
[RUN_GRADLEW] - Other compatible attribute:
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Variant 'mainSourceElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a component, and its dependencies declared externally:
[RUN_GRADLEW] - Incompatible because this component declares a component of category 'verification' and the consumer needed a library
[RUN_GRADLEW] - Other compatible attributes:
[RUN_GRADLEW] - Doesn't say anything about its target Java version (required compatibility with Java 8)
[RUN_GRADLEW] - Doesn't say anything about its elements (required them packaged as a jar)
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Doesn't say anything about its usage (required a runtime)
[RUN_GRADLEW] - Variant 'runtimeElements' capability com.facebook.react:react-native-gradle-plugin:unspecified declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
[RUN_GRADLEW] - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
[RUN_GRADLEW] - Other compatible attribute:
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Variant 'testResultsElementsForTest' capability com.facebook.react:react-native-gradle-plugin:unspecified:
[RUN_GRADLEW] - Incompatible because this component declares a component of category 'verification' and the consumer needed a library
[RUN_GRADLEW] - Other compatible attributes:
[RUN_GRADLEW] - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
[RUN_GRADLEW] - Doesn't say anything about its target Java version (required compatibility with Java 8)
[RUN_GRADLEW] - Doesn't say anything about its elements (required them packaged as a jar)
[RUN_GRADLEW] - Doesn't say anything about org.gradle.plugin.api-version (required '7.4.2')
[RUN_GRADLEW] - Doesn't say anything about its usage (required a runtime)
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] * Get more help at https://help.gradle.org
[RUN_GRADLEW] BUILD FAILED in 4s
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
Build failed
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
npx exited with non-zero code: 1
字符串
我试过更改JDK版本(使用OpenJDK 21),Gradle版本(尝试8.0.1,7.5.1和7.4.2)。我完全迷失在这里。
这是我的包。json:
{
"name": "first2-app",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"start-clearcache": "expo start -c"
},
"dependencies": {
"@react-navigation/native": "^6.1.9",
"@react-navigation/native-stack": "^6.9.15",
"@reduxjs/toolkit": "^1.9.7",
"axios": "^1.5.1",
"expo": "~49.0.15",
"expo-dev-client": "~2.4.11",
"expo-location": "~16.1.0",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
"nativewind": "^2.0.11",
"react": "18.2.0",
"react-native": "0.72.6",
"react-native-auth0": "^3.0.2",
"react-native-maps": "1.7.1",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-redux": "^8.1.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "~18.2.14",
"tailwindcss": "^3.3.2",
"typescript": "^5.1.3"
},
"private": true
}
型
eas.json:
{
"cli": {
"version": ">= 0.42.4"
},
"build": {
"development": {
"distribution": "internal",
"android": {
"gradleCommand": ":app:assembleDebug"
},
"ios": {
"buildConfiguration": "Debug"
}
},
"preview": {
"distribution": "internal",
"ios": {
"simulator": true
}
},
"production": {}
},
"submit": {
"production": {}
}
}
型
1条答案
按热度按时间l2osamch1#
这eas.json文件需要包括'通道'
字符串