首页 > 解决方案 > 从 react-native 项目中导出 APK

问题描述

我正在尝试使用此命令从 react-native 项目中导出 APK

./gradlew bundleRelease

它会引发此错误:

Build file '/Users/mohsen/Desktop/fzapp/android/app/build.gradle' line: 154

这是我终端的完整日志

trooos-MacBook-Pro:android mohsen$ ./gradlew bundleRelease

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/mohsen/Desktop/fzapp/android/app/build.gradle' line: 154

* What went wrong:
Could not compile build file '/Users/mohsen/Desktop/fzapp/android/app/build.gradle'.
> startup failed:
  build file '/Users/mohsen/Desktop/fzapp/android/app/build.gradle': 154: expecting '}', found ',' @ line 154, column 10.
             },
              ^

  1 error


* 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 5s
trooos-MacBook-Pro:android mohsen$ 

什么地方出了错 ?

关于我的环境的信息

MAC OS Catalina React Native 版本:~0.61.5 Expo 版本:~37.0.3

我先使用 Expo,然后弹出到一个普通的 react-native 项目

标签: androidreact-nativegradlebuild

解决方案


您只需要在 '}' 之后删除 ','


推荐阅读