2015-04-23 71 views
0

我的項目工作完美,直到我重新導入它。該gradle未能建立。

這是問題,我不知道如何解決它。使用Android Studio和Facebook SDK 4.0.1生成Gradle項目

:app:generateDebugResources UP-TO-DATE 
:app:mergeDebugResources 
C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6(13)semifinal\ProjectNearB 
clicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\exploded aar\com.facebook.android\facebook\4.0.1\res\drawable-hdpi-v4\com_facebook_tooltip_black_topnub.png ERROR: Unable to open PNG file 
    C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\ uild\intermediates\exploded-aar\com.google.android.gms\play-services-base\6.5.87\res\drawable-mdpi\ic_plusone_tall_off_client.png ERROR: Unable to open PNG file 
    C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\6.5.87\res\drawable-xhdpi\common_signin_btn_text_focus_light.9.png ERROR: Unable to open PNG file 
C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\6.5.87\res\drawable-hdpi\ic_plusone_small_off_client.png ERROR: Unable to open PNG file 
C:\Users\RahmaD\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe s -i 
C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\exploded-aar\com.facebook.android\facebook\4.0.1\res\drawable-hdpi-v4\com_facebook_tooltip_black_topnub.png -o 
C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\res\debug\drawable-hdpi-v4\com_facebook_tooltip_black_topnub.png 
    C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-location\6.5.87\res\drawable-hdpi\powered_by_google_dark.png ERROR: Unable to open PNG file 
    C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\6.5.87\res\drawable-hdpi\common_full_open_on_phone.png ERROR: Unable to open PNG file 
    Error:Failed to run command: 
    Error:Execution failed for task ':app:mergeDebugResources'. 
    > Error: Failed to run command: 
C:\Users\RahmaD\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe s -i  
C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\exploded-aar\com.facebook.android\facebook\4.0.1\res\drawable-hdpi-v4\com_facebook_tooltip_black_topnub.png -o C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\res\debug\drawable-hdpi-v4\com_facebook_tooltip_black_topnub.png 
Error Code:42 
Output: 
C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\exploded-aar\com.facebook.android\facebook\4.0.1\res\drawable-hdpi-v4\com_facebook_tooltip_black_topnub.png ERROR: Unable to open PNG file  C:\Users\RahmaD\Desktop\wiwan\ProjectNearByclicklong6 (13)semifinal\ProjectNearByclicklong6\ProjectNearByclicklong\ProjectNearBy\app\build\intermediates\exploded-aar\com.facebook.android\facebook\4.0.1\res\drawable-hdpi-v4\com_facebook_tooltip_black_topnub.png ERROR: Unable to open PNG file 
    :app:mergeDebugResources FAILED 42 
Error Code: 
Output: Information:BUILD FAILED 
    Information:2 errors 
    Information:0 warnings 

這是我的gradle這個文件:

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 21 
buildToolsVersion "21.1.2" 

defaultConfig { 
    applicationId "com.nearby.satoripop.projectnearby" 
    minSdkVersion 9 
    targetSdkVersion 21 
    versionCode 1 
    versionName "1.0" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
} 
dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
compile 'com.google.android.gms:play-services-location:6.5.87' 
compile project(':StaggeredGridView-master') 
compile files('libs/httpmime-4.2.6.jar') 
compile project(':facebook') 
compile files('libs/android-async-http-1.4.6.jar') 
} 

我是affraid有同樣的問題而產生的apk

+1

請問你能顯示你的gradle文件嗎? – Yurets

+0

可能重複,無論如何檢查答案。 1. http://stackoverflow.com/questions/28564094/libpng-error-at-appmergedebugresources-gradle-error-42 2.http://stackoverflow.com/questions/23359572/android-studio-execution-failed-for -task-appmergedebugresources-if-project – Yurets

回答

0

大多數的互聯網資源的建議,打開問題的圖像(在你的情況它是 com_facebook_tooltip_black_topnub.png)並以png格式再次保存。可能存在不匹配。

+0

我發佈我的gradle。這就是我在網絡中發現的,我應該用photoshop打開png並再次保存。我希望它能夠解決問題,我會試試謝謝 –

+0

@juniordevelopper,我沒有得到,如果這是你自己的形象,或在與Facebook的SDK包?無論如何,添加依賴關係要比手動集成sdk容易得多。在未來,您可以將它添加到您的依賴項中,編譯爲com.facebook.android:facebook-android-sdk:4.0.0''並按下'sync now'。所有剩下的工作IDE將爲你做:) – Yurets

+0

不,這是我第一次看到他們不是我的,我認爲有從圖書館 –

相關問題