android打包出错 failed to read PNG signature: file
来源:14-6 打包发布React Native项目【收获果实】
遗忘悳记忆
2019-11-04
E:hunheanli2Github_RNandroid>gradlew assembleRelease
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reus
ed, use --status for details
Configure project :app
WARNING: Configuration ‘compile’ is obsolete and has been replaced with ‘impleme
ntation’ and ‘api’.
It will be removed at the end of 2018. For more information see: http://d.androi
d.com/r/tools/update-dependency-configurations.html
Observed package id ‘extras;intel;Hardware_Accelerated_Execution_Manager’ in inc
onsistent location ‘E:sdk.tempPackageOperation01’ (Expected ‘E:sdkextrasin
telHardware_Accelerated_Execution_Manager’)
Configure project :react-native-code-push
WARNING: Configuration ‘compile’ is obsolete and has been replaced with ‘impleme
ntation’ and ‘api’.
It will be removed at the end of 2018. For more information see: http://d.androi
d.com/r/tools/update-dependency-configurations.html
Configure project :react-native-splash-screen
WARNING: Configuration ‘compile’ is obsolete and has been replaced with ‘impleme
ntation’ and ‘api’.
It will be removed at the end of 2018. For more information see: http://d.androi
d.com/r/tools/update-dependency-configurations.html
WARNING: Configuration ‘testCompile’ is obsolete and has been replaced with ‘tes
tImplementation’ and ‘testApi’.
It will be removed at the end of 2018. For more information see: http://d.androi
d.com/r/tools/update-dependency-configurations.html
WARNING: Configuration ‘testApi’ is obsolete and has been replaced with ‘testImp
lementation’.
It will be removed at the end of 2018. For more information see: http://d.androi
d.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (26.0.3) is ignored, as i
t is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove “buildToolsVersion ‘26.0.3’” from your build.gr
adle file, as each version of the Android Gradle Plugin now has a default versio
n of the build tools.
Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
bundle: Writing bundle output to: E:hunheanli2Github_RNandroidappuildgen
eratedassets
eact
eleaseindex.android.bundle
bundle: Done writing bundle output
bundle: Copying 13 asset files
bundle: Done copying assets
Task :app:generateBundledResourcesHashRelease
16ba5cf9701f79210158ba7992ce6ccf0ca6f0c09c76ba1f0d7c137ef0a9abac
E:hunheanli2Github_RNandroidappsrcmain
esdrawable-xxxhdpilaunch_screen
.png: error: failed to read PNG signature: file does not start with PNG signatur
e.
E:hunheanli2Github_RNandroidappsrcmain
esmipmap-xxxhdpiic_launcher.png
: error: failed to read PNG signature: file does not start with PNG signature.
Task :app:mergeReleaseResources
Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aap
t.v2.Aapt2Exception: AAPT2 error: check logs for details
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:app:mergeReleaseResources’.
Error: java.util.concurrent.ExecutionException: com.android.builder.internal.a
apt.v2.Aapt2Exception: AAPT2 error: check logs for details
-
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 1m 58s
35 actionable tasks: 4 executed, 31 up-to-date
但是E:hunheanli2Github_RNandroidappuildoutputsapkdebug/app-debug.apk 有apk 但安装之后 直接出错
1回答
-
CrazyCodeBoy
2019-11-04
从log上看是图片格式问题导致的:
ic_launcher.png : error: failed to read PNG signature: file does not start with PNG signature.
检查下你的这个ic_launcher.png图片是不是直接将JPEG的后缀名改成了png进行使用的呢,这样是不行的。
10
相似问题