[英]Gradle build failed in Android Studio
我在Ubuntu上使用Android Studio。 我啟動了Android Studio,創建了一個“新項目”並使用Shift+F10
啟動它。 它引發了以下錯誤:
/home/laptop/AndroidStudioProjects/TestIt420/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/drawable-mdpi-v4/abc_btn_radio_to_on_mtrl_000.png
Error:Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/laptop/Android/Sdk/build-tools/21.1.2/aapt'' finished with non-zero exit value 127
:app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Information:BUILD FAILED
它還向我展示了一個帶圓圈的PNG文件和一個透明背景,文件名為: abc_btn_radio_to_on_mtrl_000.png
在我剛嘗試再次運行應用程序后,我現在有2個錯誤而不是1個:
/home/laptop/AndroidStudioProjects/TestIt420/app/build/intermediates/explo ded-aar/com.android.support/appcompat-v7/22.0.0/res/drawable-hdpi- v4/abc_ic_ab_back_mtrl_am_alpha.png
Error:Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/laptop/Android/Sdk/build-tools/21.1.2/aapt'' finished with non-zero exit value 127
Error:Execution failed for task ':app:mergeDebugResources'.
> /home/laptop/AndroidStudioProjects/TestIt420/app/build/intermediates/explo ded-aar/com.android.support/appcompat-v7/22.0.0/res/drawable-hdpi- v4/abc_ic_ab_back_mtrl_am_alpha.png: Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/laptop/Android/Sdk/build-tools/21.1.2/aapt'' finished with non-zero exit value 127
Information:BUILD FAILED
你能幫助我解決這個問題嗎?
您必須安裝這些軟件包以解決此錯誤,因為Android SDK仍然無法在UBUNTU 64位上運行。
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
Android還沒有為ubuntu 64位構建SDK,從錯誤中我可以說你在64位操作系統上使用32位SDK。
您需要安裝32位庫才能在ubuntu中運行android SDK。
啟動終端並安裝以下軟件包。
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
和
右鍵單擊.../AndroidSDK/sdk/build-tools/21.1.2/aapt
文件,打開它的屬性並確保已在權限選項卡中選中 允許將文件作為程序執行 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.