[react-native] gradlew assembleRelease --debug构建成功但gradlew assembleRelease构建失败

时间:2017-04-21 09:00:03

标签: android react-native

一个疯狂的问题,当我运行gradlew assembleRelease时,错误信息是:

...
Loading dependency graph, done.easeJsAndAssets
warning: the transform cache was reset.
bundle: start
bundle: finish
bundle: Writing bundle output to: xxx\android\app\build\intermediates\assets\release\index.android.bundle
bundle: Copying 5 asset files
bundle: Done writing bundle output
bundle: Done copying assets

FAILURE: Build failed with an exception.

* What went wrong:
Unable to process incoming event 'ProgressComplete ' (ProgressCompleteEvent)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

有一些proguard的警告消息,例如重复的类等,我已经恢复了这些警告消息,但它仍然构建失败。当我添加--debug时,它构建成功,疯狂!!! p>

...
16:53:42.799 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :react-native-image-picker:assembleRelease (Thread[main,5,main]) completed. Took 0.0 secs.
16:53:42.799 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 59.019 secs, idle: 0.031 secs
16:53:42.799 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskGraphExecuter] Timing: Executing the DAG took 59.79 secs
16:53:42.799 [LIFECYCLE] [org.gradle.BuildResultLogger]
16:53:42.809 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD SUCCESSFUL
16:53:42.809 [LIFECYCLE] [org.gradle.BuildResultLogger]
16:53:42.809 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 1 mins 17.957 secs

上次更新: 如果我暂停了构建过程并等待片刻继续,它构建成功,我已将SLAVE_AAPT_TIMEOUT设置为30,它似乎无法正常工作。

1 个答案:

答案 0 :(得分:0)

将Gradle与以下开关一起使用时,问题永远不会发生:

gradlew assembleRelease --console plain