Gradle DSL Method Not Found: storeFile ()

I am using Android Studio 1.1.0. When I try to sync my Gradle file, I get the following error:

Gradle DSL Method Not Found: storeFile ()

Here is my Gradle configuration:

apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "skripsi.ubm.studenttracking" minSdkVersion 16 targetSdkVersion 21 versionCode 1 versionName "1.0" } signingConfigs { release { storeFile (project.property("Students_tracking_keystore.jks") + ".keystore") storePassword "####" keyAlias "####" keyPassword "#####" } } } 

Can anyone help?

+6
source share
1 answer

A few notes:

The DSL storeFile method has the following signature:

 public DefaultSigningConfig setStoreFile(File storeFile) 

i.e. he is awaiting File transfer. You probably need to place the File constructor in your code to make sure that you are actually creating a File object. Since you are not currently transferring the file, Gradle complains that it cannot find a method with the appropriate signature.

Secondly, you add two files to the file name: .jks and .keystore . You should include only one of them based on the suffix of the file you are linking to (this is probably .jks , but you should make sure that it is true).

In short, one of the following replacement lines will probably work for you:

 storeFile file(project.property("Students_tracking_keystore") + ".keystore") 

or

 storeFile file(project.property("Students_tracking_keystore") + ".jks") 

or

 storeFile file(project.property("Students_tracking_keystore.keystore")) 

or

 storeFile file(project.property("Students_tracking_keystore.jks")) 
+4
source

Source: https://habr.com/ru/post/983889/


All Articles