我正在尝试通过执行
expo run:android
在 android 上运行我的 android expo 项目
我收到这个错误
这是我的
settings.gradle
文件
rootProject.name = 'K53Learners'
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle");
useExpoModules()
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild(new File(["node", "--print", "require.resolve('react-native-gradle-plugin/package.json')"].execute(null, rootDir).text.trim()).getParentFile())
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../ReactAndroid");
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../ReactAndroid/hermes-engine");
}
在我的例子中,我使用 bareworkflow expo,然后运行:
npm audit fix --force
这破坏了构建,但我再次运行它然后修复了它
我不知道为什么这种事总是发生在我身上..
目录路径太长,将项目放入
Users/user/projectname
解决了我的问题..
我在 Windows 上的上一个项目中也发生了同样的事情,但出现了不同的错误..