1

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"
    }
}
Community
  • 1
  • 1
Milad
  • 119
  • 2
  • 13
  • Do the file exists at this path G:\AndroidDev\AndroidStudioProjects\Telegram-master\TMessagesProj\config\release.keystore ? – aelimill Jan 06 '16 at 09:39
  • No. The file "release‌​.keystore" doesn't exist there. – Milad Jan 06 '16 at 09:42
  • Move your keystore file there or change the path to your keystore file location – aelimill Jan 06 '16 at 09:46
  • Where's my keystore file. I tried to build signed apk. Does it make a keystore for me? If so, where is it. I'm newbie in Android development. – Milad Jan 06 '16 at 09:52
  • Yes, it creates keystore file, I do not know its location, because your chose it :) Just find it in you harddrive – aelimill Jan 06 '16 at 10:01
  • I checked it again. Generating signed apk doesn't make a release.keystore file. It makes an example.jks file. – Milad Jan 06 '16 at 10:08
  • It is a keystore file. Rename it to release.keystore or change in build.gradle to example.jks – aelimill Jan 06 '16 at 10:10
  • I renamed it and the error went away. Thanks a lot @aelimill. Now the project crashes and stops working when I run it on Genymotion. Is it possible that an application stop because of keystore issues? Or it's something different and I should look for another solution? – Milad Jan 06 '16 at 10:31
  • Post the logcat to see the crash issue – aelimill Jan 06 '16 at 10:39
  • This error looks like this one http://stackoverflow.com/questions/33765946/android-telegram-app-java-lang-unsatisfiedlinkerror-no-implementation-found – aelimill Jan 06 '16 at 12:16
  • Why don't you post your answer to this page so that it could be selected as the best answer. Thanks again... – Milad Jan 06 '16 at 14:01

3 Answers3

1

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")
Fernando Bonet
  • 576
  • 5
  • 13
0

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

Community
  • 1
  • 1
aelimill
  • 1,015
  • 1
  • 10
  • 17
0

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.