Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android gradle signingConfig error

Tags:

android

I try signing my Application like this link. I write my signingConfigs settings but I get "Could not find property" error.

This my build.gradle

apply plugin: 'android'      android {         compileSdkVersion 19         buildToolsVersion '19.0.3'         defaultConfig {             minSdkVersion 11             targetSdkVersion 19             versionCode 1             versionName "Andy Warhol"         }         buildTypes {             debug {                 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'                 debuggable false                 jniDebugBuild false                 signingConfig signingConfigs.myconfig             }             release {                 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'                 debuggable false                 jniDebugBuild false             }         }         signingConfigs {             myconfig {                 keyAlias 'xxx'                 keyPassword 'xxx'                 storeFile file('xxx')                 storePassword 'xxx'             }         }     }      dependencies {         compile 'com.android.support:appcompat-v7:+'         compile 'com.google.android.gms:play-services:4.0.30'         compile fileTree(dir: 'libs', include: ['*.jar'])         compile files('libs/picasso-2.2.0.jar')         compile files('libs/acra-4.5.0.jar')         compile files('libs/libGoogleAnalyticsServices.jar')     } 

This is my error

Gradle 'BulentTirasMobileApp' project refresh failed: Could not find property 'myconfig' on SigningConfig container.

like image 657
Olkunmustafa Avatar asked Apr 01 '14 15:04

Olkunmustafa


1 Answers

Move your signingConfigs block to appear before your buildTypes block:

    signingConfigs {         myconfig {             keyAlias 'xxx'             keyPassword 'xxx'             storeFile file('xxx')             storePassword 'xxx'         }     }     buildTypes {         debug {             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'             debuggable false             jniDebugBuild false             signingConfig signingConfigs.myconfig         }         release {             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'             debuggable false             jniDebugBuild false         }     } 

You need to define the configuration before you can use it.

like image 195
CommonsWare Avatar answered Oct 13 '22 11:10

CommonsWare