最近在用ubuntu下使用android studio調試程序時,報出以下錯誤:
Execution failed for task ':app:validateDebugSigning'.
> Unable to recreate missing debug keystore.
這個是由於android studio需要自動重新生成keystore時,沒有權限。keystore文件默認是在/root/.android目錄下。
要解決這個問題可以參考以下方法:
一 http://stackoverflow.com/questions/21415156/unable-to-recreate-missing-debug-keystore
二可以自己手動生成一個keystore,然後添加到項目中,在build.gradle文件中添加
android {
signingConfigs {
debug {
storeFile file('your keyStore')
}
}
}
也可以通過android studio File-》ProjectStructure-》signing 選擇自己的keystore添加。
android studio生成keystore方法,請參考(也可自己搜資料,比較簡單):