1

According to many topics about configuring gradle to sign apk I used this solution. It seems it takes proper values, however I cannot success whole operation. Probably it could be a problem with letter "ł" which is even showing wrong in terminal. I need help, because I don't know what to do now. I've spent about 4 hours on it...

This is main project app gradle properites file:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"    

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 19
    }

    signingConfigs {
        release {
            storeFile file(RELEASE_STORE_FILE)

            storePassword RELEASE_KEY_ALIAS

            keyAlias RELEASE_KEY_ALIAS

            keyPassword RELEASE_KEY_PASSWORD
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }

}

dependencies {
    //...
}

This file takes data from ~/.gradle/gradle.properties file in Window's user dir.

org.gradle.parallel=true
org.gradle.daemon=false

    RELEASE_STORE_FILE=C:/users/xxx/f1/f1/android_market_key
    RELEASE_STORE_PASSWORD=lololo
    RELEASE_KEY_ALIAS=łłłł
    RELEASE_KEY_PASSWORD=lololo

I've tried use:

compileOptions.encoding = "UTF-8"

or

tasks.withType(Compile) {
    options.encoding = "UTF-8"
}

or even adding to gradlew.bat some options for -D* to set encoding and still fail.

Please help, I stucked.

Community
  • 1
  • 1
deadfish
  • 11,996
  • 12
  • 87
  • 136

3 Answers3

0

Check the encoding of the gradle.properties file and make sure it's UTF-8.

Some editors (such as Notepad) default to ANSI encoding, that will cause problems in case if the file contains non-ASCII characters.

(Example: In Notepad: File -> Save As -> Encoding)

matiash
  • 54,791
  • 16
  • 125
  • 154
0

So I found out partially solution, every where where I needed to use special chars I used reading from console, and it finally worked:

Solution:

apply plugin: 'android'

android {


    compileSdkVersion 19
    buildToolsVersion '19.1.0'

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 19
    }

    signingConfigs {
        release {
            storeFile file(RELEASE_STORE_FILE)
            storePassword RELEASE_STORE_PASSWORD

            def console = System.console()
            if (console != null) {
                keyAlias System.console().readLine("\n\$ Enter key alias: ")
            }

            keyPassword RELEASE_KEY_PASSWORD
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }

    productFlavors {
    }
}

dependencies {
    //my dependencies
}
deadfish
  • 11,996
  • 12
  • 87
  • 136
0

After having the same issue and spending some hours on it, I managed to make a successful build as follows:

  1. Followed the instructions described here. So, instead of using gradle.properties to store the values, I stored them in a custom file signing.properties.

  2. Changed the file reading part as follows:

    props.load( new InputStreamReader( new FileInputStream(propFile), "UTF-8"))

I hope it helps.

Emre Dirican
  • 397
  • 5
  • 15