2016-03-23 127 views
20

我嘗試構建簽名APK時出現此錯誤。我最近升級到API 23,但之後成功生成了APK:s。我很困惑。尋求幫助,並建議如何解決這個問題。這裏的錯誤Android錯誤建築簽名APK

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':app:validateExternalOverrideSigning'. 
> Keystore file /Users/me/Desktop/final apps/keystore.jks not 
found for signing config 'externalOverride'. 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or -- 
debug option to get more log output. 

和日誌

Information:Gradle tasks [:app:assembleRelease] 
:app:preBuild UP-TO-DATE 
:app:preReleaseBuild UP-TO-DATE 
:app:checkReleaseManifest 
:app:preDebugBuild UP-TO-DATE 
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE 
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE 
:app:prepareReleaseDependencies 
:app:compileReleaseAidl UP-TO-DATE 
:app:compileReleaseRenderscript UP-TO-DATE 
:app:generateReleaseBuildConfig UP-TO-DATE 
:app:generateReleaseAssets UP-TO-DATE 
:app:mergeReleaseAssets UP-TO-DATE 
:app:generateReleaseResValues UP-TO-DATE 
:app:generateReleaseResources UP-TO-DATE 
:app:mergeReleaseResources UP-TO-DATE 
:app:processReleaseManifest UP-TO-DATE 
:app:processReleaseResources UP-TO-DATE 
:app:generateReleaseSources UP-TO-DATE 
:app:compileReleaseJavaWithJavac 
Note: Some input files use or override a deprecated API. 
Note: Recompile with -Xlint:deprecation for details. 
:app:compileReleaseNdk UP-TO-DATE 
:app:compileReleaseSources 
:app:lintVitalRelease 
:app:transformClassesWithDexForRelease 
:app:mergeReleaseJniLibFolders 
:app:transformNative_libsWithMergeJniLibsForRelease 
:app:processReleaseJavaRes UP-TO-DATE 
:app:transformResourcesWithMergeJavaResForRelease 
:app:validateExternalOverrideSigning FAILED 
Error:Execution failed for task ':app:validateExternalOverrideSigning'. 
> Keystore file /Users/me/Desktop/final apps/keystore.jks not found for 
signing config 'externalOverride'. 

這裏是我的搖籃

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 23 
buildToolsVersion "23.0.2" 


defaultConfig { 
    applicationId "com.waffles.vatsandbats" 
    minSdkVersion 14 
    targetSdkVersion 23 
} 

buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.txt'  
    } 
} 
} 

dependencies { 

compile files('libs/acra-4.7.0-javadoc.jar') 
compile files('libs/acra-4.7.0-sources.jar') 
compile files('libs/acra-4.7.0.jar') 
compile 'com.google.android.gms:play-services-appindexing:8.1.0' 
compile files('libs/activation.jar') 
compile files('libs/mail.jar') 
compile files('libs/additionnal.jar') 
compile 'com.android.support:support-v4:23.1.1' 
compile 'com.android.support:appcompat-v7:23.1.1' 


} 

回答

54

我找到了解決辦法。我錯誤地找到了keystore.jks文件的路徑。 搜索了我的電腦上的文件使用該路徑,一切正常!

+0

>檢查路徑我運動我之後得到這個錯誤。 jks文件到另一個位置,忘了在android studio中更新x)謝謝 – Arbitur

7

這是在生成.jks文件時寫下「文件名」而不是路徑時可能出現的問題。生成一個新的,放在桌面(或任何其他真實路徑),並重新生成APK。

8

文件 - >的Invalidate緩存&重新開始......

建設 - >打造簽署APK - 在對話框

Check the key store path