Android Studio 开发遇到错误和解决方法集合

1 .Duplicate files copied in APK META-INF/LICENSE.txt

android {
    packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    }
}
My logcat: log Execution failed for task ':Prog:packageDebug'.

Duplicate files copied in APK META-INF/LICENSE.txt File 1: /home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar File 2: /home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar

解决方法

android {  
    packagingOptions {  
        exclude 'META-INF/DEPENDENCIES.txt'  
        exclude 'META-INF/LICENSE.txt'  
        exclude 'META-INF/NOTICE.txt'  
        exclude 'META-INF/NOTICE'  
        exclude 'META-INF/LICENSE'  
        exclude 'META-INF/DEPENDENCIES'  
        exclude 'META-INF/notice.txt'  
        exclude 'META-INF/license.txt'  
        exclude 'META-INF/dependencies.txt'  
        exclude 'META-INF/LGPL2.1'  
    }  
}  

2 .empty throwable the apk file does not exist on disk

每次运行代码有修改 app无修改, clean 之后 ,提示找不到上个版本的apk ,疑似缓存问题,按照下图操作后正常

附 清除Android Studio 缓存

rm -rfv ~/Library/Caches/AndroidStudio*    
梦想还是要有的,万一实现了呢?