Tensorflow编译Android版本步骤及填坑(CentOS && Mac)

在写此blog的时候,tensorflow更新到r1.3,bazel更新到0.5.3

1.下载tensorflow源代码,Tensorflow代码

git clone https://github.com/tensorflow/tensorflow.git

官方文档见

2.下载并配置jdk8【bazel需要jdk8】

官网下载地址, 另有国内下载及配置文档jdk,一定注意配置完后,用javac -version验证一下

3.下载bazel

由于我的服务器并没有bazel的安装包,所以只能用源码下载,见bazel官网文档

需要下载对应版本的sh文件,并安装bazel。安装后可以执行bazel version验证

4.下载【当前最新bazel要求android api版本在24.0.3以上】

可能需要翻墙,或者设置国内代理服务器,android sdk

5.下载并配置android-ndk【目前不能超过r12b】

官方地址android ndk,

6.修改WORKSPACE文件【建议先切到某个release分支,git pull,主要涉及到android-sdk和android-ndk的配置修改】

android_sdk_repository(
    name = "androidsdk",
    api_level = 24,
#    # Ensure that you have the build_tools_version below installed in the
#    # SDK manager as it updates periodically.
    build_tools_version = "25.0.3",
#    # Replace with path to Android SDK on your system
    path = "/usr/local/android-sdk-macosx",
)
#
# Android NDK r12b is recommended (higher may cause issues with Bazel)
android_ndk_repository(
    name="androidndk",
    path="/usr/local/android-ndk-r12b",
#    # This needs to be 14 or higher to compile TensorFlow.
#    # Note that the NDK version is not the API level.
    api_level=14)
注意注意:sdk中api_level和build_tools_version并不一定要都是25,ndk_repository中的api_level是指androidsdk的api,这里写14就可以了,不管你sdk中有没有该版本

7.执行编译命令【注意要在tensorflow仓库根目录下】

bazel build //tensorflow/examples/android:tensorflow_demo
编译成功后会显示
Target //tensorflow/examples/android:tensorflow_demo up-to-date:
  bazel-bin/tensorflow/examples/android/tensorflow_demo_deploy.jar
  bazel-bin/tensorflow/examples/android/tensorflow_demo_unsigned.apk
  bazel-bin/tensorflow/examples/android/tensorflow_demo.apk
8.此时可以用adb命令,将apk安装到手机上,观看效果。【会有TF Classify/TF Detect/TF Stylize三个apk】

CentOS和Mac都可以编译通过。

=====================此行都是眼泪=====================

1.千万不要尝试去用比r12b更高版本的android ndk

2.在linux上下载的android sdk,无法在mac上使用。反之却可以。

3.一定要用当前已经稳定发布的分支,否则,根本不知道自己会遇到啥坑。


记录一个错误,当前环境:Mac 10.12.1, jdk 1.8.0_101, bazel 0.5.3, sdk 25.0.3(从linux copy的),ndk r12b。

严重: Error during merging resources

com.google.devtools.build.android.AndroidResourceMerger$MergingException: java.io.IOException: Failures during writing.

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidResourceMerger.mergeData(AndroidResourceMerger.java:104)

at com.google.devtools.build.android.AndroidResourceMerger.mergeData(AndroidResourceMerger.java:153)

at com.google.devtools.build.android.AndroidResourceProcessingAction.main(AndroidResourceProcessingAction.java:349)

at com.google.devtools.build.android.ResourceProcessorBusyBox$Tool$1.call(ResourceProcessorBusyBox.java:55)

at com.google.devtools.build.android.ResourceProcessorBusyBox.main(ResourceProcessorBusyBox.java:147)

Caused by: java.io.IOException: Failures during writing.

at com.google.devtools.build.android.FailedFutureAggregator$1.create(FailedFutureAggregator.java:39)

at com.google.devtools.build.android.FailedFutureAggregator$1.create(FailedFutureAggregator.java:36)

at com.google.devtools.build.android.FailedFutureAggregator.aggregateAndMaybeThrow(FailedFutureAggregator.java:70)

at com.google.devtools.build.android.AndroidDataWriter.flush(AndroidDataWriter.java:283)

at com.google.devtools.build.android.UnwrittenMergedAndroidData.write(UnwrittenMergedAndroidData.java:67)

at com.google.devtools.build.android.AndroidResourceMerger.mergeData(AndroidResourceMerger.java:102)

... 4 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_action_info.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_action_info.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_action_info.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_launcher.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_launcher.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_launcher.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/tile.9.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/tile.9.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/tile.9.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/tile.9.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/tile.9.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/tile.9.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-mdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-mdpi-v4/ic_action_info.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-mdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-mdpi-v4/ic_action_info.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-mdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-mdpi-v4/ic_action_info.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-mdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-mdpi-v4/ic_launcher.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-mdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-mdpi-v4/ic_launcher.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-mdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-mdpi-v4/ic_launcher.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xhdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xhdpi-v4/ic_action_info.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xhdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xhdpi-v4/ic_action_info.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xhdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xhdpi-v4/ic_action_info.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xhdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xhdpi-v4/ic_launcher.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xhdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xhdpi-v4/ic_launcher.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xhdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xhdpi-v4/ic_launcher.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xxhdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xxhdpi-v4/ic_action_info.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xxhdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xxhdpi-v4/ic_action_info.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xxhdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xxhdpi-v4/ic_action_info.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xxhdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xxhdpi-v4/ic_launcher.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xxhdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xxhdpi-v4/ic_launcher.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-xxhdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-xxhdpi-v4/ic_launcher.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more


Exception in thread "main" com.google.devtools.build.android.AndroidResourceMerger$MergingException: java.io.IOException: Failures during writing.

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidResourceMerger.mergeData(AndroidResourceMerger.java:104)

at com.google.devtools.build.android.AndroidResourceMerger.mergeData(AndroidResourceMerger.java:153)

at com.google.devtools.build.android.AndroidResourceProcessingAction.main(AndroidResourceProcessingAction.java:349)

at com.google.devtools.build.android.ResourceProcessorBusyBox$Tool$1.call(ResourceProcessorBusyBox.java:55)

at com.google.devtools.build.android.ResourceProcessorBusyBox.main(ResourceProcessorBusyBox.java:147)

Caused by: java.io.IOException: Failures during writing.

at com.google.devtools.build.android.FailedFutureAggregator$1.create(FailedFutureAggregator.java:39)

at com.google.devtools.build.android.FailedFutureAggregator$1.create(FailedFutureAggregator.java:36)

at com.google.devtools.build.android.FailedFutureAggregator.aggregateAndMaybeThrow(FailedFutureAggregator.java:70)

at com.google.devtools.build.android.AndroidDataWriter.flush(AndroidDataWriter.java:283)

at com.google.devtools.build.android.UnwrittenMergedAndroidData.write(UnwrittenMergedAndroidData.java:67)

at com.google.devtools.build.android.AndroidResourceMerger.mergeData(AndroidResourceMerger.java:102)

... 4 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_action_info.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_action_info.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_action_info.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_action_info.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more

Suppressed: com.google.devtools.build.android.AndroidResourceMerger$MergingException: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_launcher.png'

at com.google.devtools.build.android.AndroidResourceMerger$MergingException.wrapException(AndroidResourceMerger.java:45)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:83)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:63)

at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111)

at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58)

at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.android.ide.common.internal.PngException: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_launcher.png'

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:79)

at com.google.devtools.build.android.AndroidDataWriter$CrunchTask.call(AndroidDataWriter.java:81)

... 7 more

Caused by: com.android.ide.common.process.ProcessException: Return code 1 for process 'bazel-out/host/bin/external/androidsdk/aapt_binary s -i /private/var/tmp/_bazel_jinya3/c1bdc3c8f9191ec802eccb701ec6e0e7/execroot/org_tensorflow/tensorflow/examples/android/res/drawable-hdpi/ic_launcher.png -o /var/folders/4s/rdkxhx5x219bbpsh5f8sp23r0000gn/T/android_resources_tmp2566221013756771446/merged_resources/drawable-hdpi-v4/ic_launcher.png'

at com.android.ide.common.process.ProcessResultImpl.assertNormalExitValue(ProcessResultImpl.java:48)

at com.android.ide.common.internal.AaptCruncher.crunchPng(AaptCruncher.java:77)

... 8 more


阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页