1. 程式人生 > >Android Studio專案打包:常見錯誤3:com.android.ide.common.process.ProcessException: Failed to execute aapt

Android Studio專案打包:常見錯誤3:com.android.ide.common.process.ProcessException: Failed to execute aapt

Error while generating dependencies split APK
com.android.ide.common.process.ProcessException: Failed to execute aapt

Caused by: java.util.NoSuchElementException

:app:transformDexWithInstantRunDependenciesApkForDebug FAILED
:app:buildInfoGeneratorDebug

FAILURE: Build failed with an exception.

WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.

* What went wrong:
Execution failed for task ':app:transformDexWithInstantRunDependenciesApkForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: Failed to execute aapt

 

解決方式:

之前在專案打包釋出apk的時候出錯,新增語句如下圖:

android.enableAapt2=false

後來發現,它對打包釋出沒有什麼影響!但是專案執行不了啦!

報如上錯誤,要想專案能執行就把此條程式碼給註釋了!

相關連結:Android Studio專案打包:常見錯誤1:Execution failed for task ':app:mergeReleaseResources'

 

擴充套件:

如果加此條語句進行打包釋出apk,對防反編譯是不是一道坎呢?

因為反編譯後,有此條語句專案執行不了!

還有此條語句的深刻含義?找個時間好好研究下吧。。。。。。