编辑:稍微简化了我的帖子。
我正在运行 Java 11。我刚刚升级到 17,试图尝试解决该问题。
运行eas build --platform android --profile production --clear-cache --build-logger-level=debug
输出:
Running 'gradlew :app:bundleRelease' in /home/expo/workingdir/build/android
Downloading https://services.gradle.org/distributions/gradle-7.3.3-all.zip
10%.
20%.
30%.
40%.
50%.
60%
70%.
80%.
90%.
100%
Welcome to Gradle 7.3.3!
Here are the highlights of this release:
- Easily declare new test suites in Java projects
- Support for Java 17
- Support for Scala 3
For more details see https://docs.gradle.org/7.3.3/release-notes.html
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.3.3/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
FAILURE: Build failed with an exception.
* Where:
Script '/home/expo/workingdir/build/node_modules/expo/scripts/autolinking.gradle' line: 4
* What went wrong:
A problem occurred evaluating script.
> Could not find method exec() for arguments [autolinking_9szxo5may2zrgnhpqcnrso9ei$_run_closure1@58dbf0e1] on object of type org.gradle.api.internal.provider.DefaultProviderFactory_Decorated.
* 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 8s
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
android/app/build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
namespace 'com.truestreetcarclub.tsccmemberapp' // Add this line
compileSdkVersion rootProject.ext.compileSdkVersion
buildFeatures {
buildConfig true // Add this line to enable buildConfig feature
}
defaultConfig {
applicationId "com.truestreetcarclub.tsccmemberapp" // Set your package name here
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.facebook.react:react-native:+'
}
构建 iOS 时没有遇到任何问题,我怀疑存在某种形式的不兼容性,但我一生都无法调试此问题。有任何指示可以转向哪里吗?
我一直在用这个自动链接兜圈子。我已经删除了node_modules无数次并重新安装,清除缓存以确保没有任何愚蠢的事情,但没有运气。
对于那些感兴趣的人来说,这是一个世博会管理的工作流程应用程序。这是我第一次使用 expo/react-native。我不知道根本不应该有“Android”文件夹。
因此,我在尝试诊断构建错误时走上了错误的道路,我怀疑这是由于博览会的设置方式造成的。
我不知道 Android 文件夹是如何创建的(也许是已安装的软件包导致的??),但是删除 Android 文件夹后,构建就完成了。
希望这对某人有帮助。