请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

android打包出错 failed to read PNG signature: file

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 但安装之后 直接出错

正在回答 回答被采纳积分+3

1回答

CrazyCodeBoy 2019-11-04 21:24:32

从log上看是图片格式问题导致的:

ic_launcher.png
: error: failed to read PNG signature: file does not start with PNG signature.

检查下你的这个ic_launcher.png图片是不是直接将JPEG的后缀名改成了png进行使用的呢,这样是不行的。

1 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信