问题
I downloaded a project from GitHub and opened it by Android Studio. All required build tools and Android support repositories were automatically downloaded through Android Studio.
https://github.com/DrKLO/Telegram
Now that I try to run the project, I get an error in Massages.
Error:A problem was found with the configuration of task ':TMessagesProj:packageDebug'.
> File 'G:\AndroidDev\AndroidStudioProjects\Telegram-master\TMessagesProj\config\release.keystore' specified for property 'signingConfig.storeFile' does not exist.
I found some other threads on Stack Exchange:
Gradle signing app with packageRelease “specified for property 'signingConfig.storeFile' does not exist”
Android specified for property 'signingConfig.storeFile' does not exist
and I created the keystores as they suggested, but I'm still getting that error when I click the run button. They seem to be different from mine.
I also generated the signed APK and when I tried to install it on a device, the program crashed and stopped and I guess it might be caused by the mentioned problem.
I'm sure it should work correctly because it's the official source of Telegram messenger. https://github.com/DrKLO/Telegram
In case you need the file build.gradle:
apply plugin: 'com.android.application'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:23.1.+'
compile 'com.google.android.gms:play-services:3.2.+'
compile 'net.hockeyapp.android:HockeySDK:3.6.+'
compile 'com.googlecode.mp4parser:isoparser:1.0.+'
}
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
useLibrary 'org.apache.http.legacy'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
signingConfigs {
debug {
storeFile file("config/release.keystore")
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
release {
storeFile file("config/release.keystore")
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
buildTypes {
debug {
debuggable true
jniDebuggable true
signingConfig signingConfigs.debug
applicationIdSuffix ".beta"
}
release {
debuggable false
jniDebuggable false
signingConfig signingConfigs.release
}
foss {
debuggable false
jniDebuggable false
signingConfig signingConfigs.release
}
}
sourceSets.main {
jniLibs.srcDir 'libs'
jni.srcDirs = [] //disable automatic ndk-build call
}
sourceSets.debug {
manifest.srcFile 'config/debug/AndroidManifest.xml'
}
sourceSets.release {
manifest.srcFile 'config/release/AndroidManifest.xml'
}
sourceSets.foss {
manifest.srcFile 'config/foss/AndroidManifest.xml'
}
defaultConfig {
minSdkVersion 8
targetSdkVersion 23
versionCode 695
versionName "3.3.2"
}
}
回答1:
1) check if storeFile exists at the path G:\AndroidDev\AndroidStudioProjects\Telegram-master\TMessagesProj\config\release.keystore
2) if not - rename / move your keystore file there or change the path to your keystore file location.
It should work now. If you have a build problem while concerning native code try this topic Android Telegram App --> java.lang.UnsatisfiedLinkError: No implementation found for void
回答2:
your problem is: the Android Studio is searching for a key file that you told it should be there... but isn't.
Where you told Android Studio the file would be there?
storeFile file("config/release.keystore")
How to create this missing file? https://developer.android.com/studio/publish/app-signing.html
if you already have the keystore created check if it's on the right place, generally I use a folder called 'keystore' instead of 'config', much more intuitive when you browse searching for it ;)
storeFile rootProject.file("keystore/release.keystore")
回答3:
To generate the key-store, got to Build > Generate Signed APK and click on New Key Store, now rename the generated file to release.keystore and move it to TMessagesProj/config.
Android Studio generates .jks files. Just rename it from release.jks to release.keystore. The build will then succeed.
来源:https://stackoverflow.com/questions/34629723/signingconfig-storefile-does-not-exist-when-i-try-to-run-the-project