Hi guys i download a project from github and i imported in android studio , after imported am getting error
Gradle sync failed: Cause: assert localProps['keystore.props.file']
| |
| null
[ndk.dir:E:\sdk\ndk-bundle, sdk.dir:E:\sdk]
Consult IDE log for more details (Help | Show Log)
Gradle File:
signingConfigs {
release {
def Properties localProps = new Properties()
localProps.load(new FileInputStream(file('../local.properties')))
def Properties keyProps = new Properties()
assert localProps['keystore.props.file'];
keyProps.load(new FileInputStream(file(localProps['keystore.props.file'])))
storeFile file(keyProps["store"])
keyAlias keyProps["alias"]
storePassword keyProps["storePass"]
keyPassword keyProps["pass"]
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), file('proguard-project.txt')
signingConfig signingConfigs.release
}
publicBeta.initWith(buildTypes.release)
publicBeta {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), file('proguard-project.txt')
versionNameSuffix " Beta " + versionProps['betaNumber']
}
publicDebug.initWith(buildTypes.publicBeta)
publicDebug {
debuggable true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), file('proguard-project.txt')
versionNameSuffix " Debug Beta " + versionProps['betaNumber']
}
}
}
I realy don't know what to do.
Does anyone have any suggestions?.
In the root folder of your project, you should have
keystore.properties
andlocal.properties
files.keystore.properties
should have something like this:In
local.properties
, add the last line.See a commit here or check the modified project.
Or if you need a quick dirty fix, just make the gradle script the same as a standard one by replacing the android block with this:
When I got such an error, it was because I was using JDK8, while the imported github repo was using JDK7.
Also make sure you have "Android Support Repository" installed from SDK Manager > Extras.