React Native Android Bundle发行版挂在:app:transformDexArchiveWithDexMergerForRelease

时间:2019-06-19 09:36:24

标签: android react-native

运行react-native run-androidreact-native run-android --variant=release,该应用程序可以在Android设备上构建并正常运行。 iOS的构建和发布也可以很好地解决这一问题。我遵循了signing instructions here

当我运行./gradlew bundleRelease时,前几个任务很快就成功完成,但是该过程挂起了:app:transformDexArchiveWithDexMergerForRelease。它已经执行了一个多小时。以下是完整的日志。我不确定如何进行最佳调试。我可以在命令中添加任何标志吗?

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variantOutput.getProcessManifest()' is obsolete and has been replaced with 'variantOutput.getProcessManifestProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessManifest(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variant.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getPackageApplication(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Configure project :lottie-react-native
publishNonDefault is deprecated and has no effect anymore. All variants are now published.

> Configure project :react-native-cookies
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.0.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :react-native-firebase
react-native-firebase: using React Native prebuilt binary from /Users/davidadler/Projects/app/node_modules/react-native/android

> Configure project :react-native-webview
:react-native-webview:reactNativeAndroidRoot /Users/davidadler/Projects/app/node_modules/react-native/android

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
info Writing bundle output to:, /Users/davidadler/Projects/app/android/app/build/generated/assets/react/release/index.android.bundle
info Done writing bundle output
info Copying 22 asset files
info Done copying assets

> Task :app:processReleaseGoogleServices
Parsing json file: /Users/davidadler/Projects/app/android/app/google-services.json

> Task :app:generateBundledResourcesHashRelease
03a478725b08cbc57d0ab5d9fb1cc3a78e325c451b00efcc325a1b5deb1e79e9
<==========---> 79% EXECUTING [10m 0s]
<==========---> 79% EXECUTING [10m 0s]rForRelease
<==========---> 79% EXECUTING [10m 0s]rForRelease
<==========---> 79% EXECUTING [10m 1s]rForRelease
<==========---> 79% EXECUTING [10m 1s]rForRelease
<==========---> 79% EXECUTING [10m 1s]rForRelease
<==========---> 79% EXECUTING [44m 51s]
<==========---> 79% EXECUTING [44m 51s]ForRelease
<==========---> 79% EXECUTING [44m 51s]ForRelease
<==========---> 79% EXECUTING [45m 4s]
> :app:transformDexArchiveWithDexMergerForRelease

1 个答案:

答案 0 :(得分:0)

同一问题,我正在尝试将我们的应用程序从0.59.2更新到0.59.9

似乎已通过在org.gradle.jvmargs=-Xmx2048M -XX\:MaxHeapSize\=32g上添加android/gradle.properties来解决了这一问题-引用此答案Gradle build of Android app in VSTS failing after running out of memory

此外,我在android的{​​{1}}部分中也有此内容

android/app/build.gradle