Expo React Native:构建失败:Gradle 构建失败,出现未知错误。有关更多信息,请参阅“运行 gradlew”阶段的日志

问题描述 投票:0回答:1

我无法使用 expo for android 构建我的应用程序。在模拟器上一切正常。

我启动命令行

eas build -p android --profile preview

在我的文件 eas.json 中使用此配置

{
  "build": {
    "preview": {
      "android": {
        "buildType": "apk"
      }
    }
  }
}

我在博览会控制台中收到此错误

> Task :expo-modules-core:configureCMakeRelWithDebInfo[arm64-v8a]
"Install CMake 3.22.1 v.3.22.1" finished.
> Task :react-native-ad-manager:extractReleaseAnnotations
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:createBundleReleaseJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 1
* 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 3m 26s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
370 actionable tasks: 370 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

当我使用此命令行检查时

npx expo-doctor

我的依赖项一切似乎都是正确的

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ Check if the project meets version requirements for submission to app stores
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check for app config fields that may not be synced in a non-CNG project
✔ Check npm/ yarn versions
✔ Check for issues with metro config
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that packages match versions required by installed Expo SDK
✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!

我的app.json

{
  "expo": {
    "name": "Breathe",
    "slug": "Breathe",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "cover",
      "backgroundColor": "#2196F3"
    },
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.mergelight.breathe"
    },
    "android": {
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.mergelight.breathe"
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "plugins": [
      "expo-secure-store",
      "expo-localization"
    ],
    "extra": {
      "eas": {
        "projectId": "..."
      }
    }
  }
}

你能帮我获得我的 Android 版本吗? 谢谢

javascript typescript react-native expo
1个回答
0
投票

我设法通过创建一个新项目并将源代码从旧项目移动到新项目来获得我的构建。

有人可以向我解释一下吗?我很好奇

© www.soinside.com 2019 - 2024. All rights reserved.