2016-05-03 74 views
-2

當我添加的ImageView我的佈局爲何顯示錯誤AAPT ERR(外觀爲817338050):libpng的錯誤:不是PNG文件當我添加imageview爲什麼顯示錯誤libpng錯誤:不是PNG文件?

失敗

失敗:建立失敗,一個例外。

  • 出錯了: 執行失敗的任務':app:mergeDebugResources'。

    Some file crunching failed, see logs for details

我試圖this但仍然沒有爲我工作..我的文件名splashscreen.png

logcat的

Information:Gradle tasks [:app:assembleDebug] 
:app:preBuild UP-TO-DATE 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:library:preBuild UP-TO-DATE 
:library:preReleaseBuild UP-TO-DATE 
:library:compileReleaseNdk UP-TO-DATE 
:library:compileLint 
:library:copyReleaseLint UP-TO-DATE 
:library:checkReleaseManifest 
:library:prepareReleaseDependencies 
:library:compileReleaseAidl UP-TO-DATE 
:library:compileReleaseRenderscript UP-TO-DATE 
:library:generateReleaseBuildConfig UP-TO-DATE 
:library:generateReleaseAssets UP-TO-DATE 
:library:mergeReleaseAssets UP-TO-DATE 
:library:generateReleaseResValues UP-TO-DATE 
:library:generateReleaseResources UP-TO-DATE 
:library:packageReleaseResources UP-TO-DATE 
:library:processReleaseManifest UP-TO-DATE 
:library:processReleaseResources UP-TO-DATE 
:library:generateReleaseSources UP-TO-DATE 
:library:compileReleaseJavaWithJavac UP-TO-DATE 
:library:extractReleaseAnnotations UP-TO-DATE 
:library:mergeReleaseProguardFiles UP-TO-DATE 
:library:packageReleaseRenderscript UP-TO-DATE 
:library:processReleaseJavaRes UP-TO-DATE 
:library:transformResourcesWithMergeJavaResForRelease UP-TO-DATE 
:library:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE 
:library:mergeReleaseJniLibFolders UP-TO-DATE 
:library:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE 
:library:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE 
:library:bundleRelease UP-TO-DATE 
:app:prepareComAndroidSupportAnimatedVectorDrawable2400Alpha2Library UP-TO-DATE 
:app:prepareComAndroidSupportAppcompatV72400Alpha2Library UP-TO-DATE 
:app:prepareComAndroidSupportDesign2400Alpha2Library UP-TO-DATE 
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE 
:app:prepareComAndroidSupportRecyclerviewV72400Alpha2Library UP-TO-DATE 
:app:prepareComAndroidSupportSupportV42400Alpha2Library UP-TO-DATE 
:app:prepareComAndroidSupportSupportVectorDrawable2400Alpha2Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServices840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesCast840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesDrive840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesFitness840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesGames840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesLocation840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesMaps840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesNearby840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesPlus840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesVision840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesWallet840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesWearable840Library UP-TO-DATE 
:app:prepareComGoogleMapsAndroidAndroidMapsUtils043Library UP-TO-DATE 
:app:prepareDeHdodenhofCircleimageview130Library UP-TO-DATE 
:app:prepareEPlaceCopy2CopyLibraryUnspecifiedLibrary UP-TO-DATE 
:app:prepareDebugDependencies 
:app:compileDebugAidl UP-TO-DATE 
:app:compileDebugRenderscript UP-TO-DATE 
:app:generateDebugBuildConfig UP-TO-DATE 
:app:generateDebugAssets UP-TO-DATE 
:app:mergeDebugAssets UP-TO-DATE 
:app:generateDebugResValues UP-TO-DATE 
:app:generateDebugResources UP-TO-DATE 
:app:mergeDebugResources 
AAPT err(Facade for 817338050): libpng error: Not a PNG file 
Error:Execution failed for task ':app:mergeDebugResources'. 
> Some file crunching failed, see logs for details 
Information:BUILD FAILED 
Information:Total time: 16.704 secs 
Information:1 error 
Information:0 warnings 
Information:See complete output in console 

,這是我splashscreen.xml

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="#0099cb" 
    android:orientation="vertical" > 



    <ImageView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:src="@drawable/splashscreen"/> 

</RelativeLayout> 
+0

閃屏是PNG圖像嗎? –

+2

檢查這個答案:http://stackoverflow.com/questions/23366222/libpng-error-not-a-png-file-error-showing-in-android-studio –

+0

@ShashankUdupa是的 –

回答

0

你可能犯了一個錯誤。你是否直接更改擴展名? 你必須使用類似paint或photoshop的東西來改變擴展名,而不是重命名它。

+0

我試過了,但仍然沒有爲我工作。原始文件名是E-Place.png,我用photoshop打開它,並保存爲名稱splashscreen.png到可繪製文件夾 –

+0

您在第一次使用的圖像是以哪種格式? – Devam03

+0

png。我使用photoshop –

相關問題