./gradlew assembleRelease构建React Native Web View而不是我的项目

时间:2019-07-03 17:20:30

标签: android react-native gradle android-gradle apk

我正在尝试从我的Android项目生成版本APK输出。我也automated signing,以便可以通过终端进行部署。

当我在Android Studio中转到Build > Generate Signed Bundle / APK时,需要花费几分钟,并成功在release/app-release.apk处生成签名的APK。

但是,当我进入我的React Native项目根目录并键入:

cd android && ./gradlew assembleRelease

构建大约需要一分钟,构建成功,但仅构建React Native Web View,不尝试构建我的项目,并且不生成APK:

can-mbp:myapp-Mobile can$ cd android && ./gradlew assembleRelease

> Configure project :react-native-webview
:react-native-webview:reactNativeAndroidRoot /Users/Can/Documents/Programming/React/myapp-Mobile/node_modules/react-native/android

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
info Writing bundle output to:, /Users/Can/Documents/Programming/React/myapp-Mobile/android/app/build/generated/assets/react/release/index.android.bundle
info Done writing bundle output
info Copying 68 asset files
info Done copying assets

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1m 1s
338 actionable tasks: 2 executed, 336 up-to-date

我在做什么错了?

更新:这是我的./gradlew projects

的输出
Root project 'MyApp'
+--- Project ':@react-native-community_async-storage'
+--- Project ':@react-native-community_geolocation'
+--- Project ':app'
+--- Project ':bugsnag-react-native'
+--- Project ':react-native-geolocation-service'
+--- Project ':react-native-gesture-handler'
+--- Project ':react-native-intercom'
+--- Project ':react-native-linear-gradient'
+--- Project ':react-native-onesignal'
+--- Project ':react-native-static-safe-area-insets'
+--- Project ':react-native-svg'
\--- Project ':react-native-webview'

1 个答案:

答案 0 :(得分:1)

也尝试进行干净的构建

./gradlew clean
./gradlew assembleDebug or ./gradlew assembleRelease

如果问题仍然存在,请运行命令以了解项目列表。

./gradlew projects