Я пытаюсь отладить свою ошибку в Proguard. Мой проект работает нормально с отладкой, но не с Proguard. Любая помощь будет оценена.
- Я пробовал с
ignore warning
в Proguard. Однако приложение падает с созданным APK.
- Текущие настройки Proguard не работают. Консоль сообщений, которую я загрузил в Gist
- Build.gradle указан ниже
Prodguard-project.txt в gist
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
build.gradle
apply plugin: 'com.android.application'
apply from: rootProject.file('gradle/codequality.gradle')
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
versionCode 49
versionName "1.8.8"
minSdkVersion 14
targetSdkVersion 22
buildConfigField 'String', 'BUILD_TAG', '"' + getBuildTag() + '"'
buildConfigField 'String', 'OWM_API_KEY', '"' + getOpenWeatherMapApiKey() + '"'
buildConfigField 'boolean', 'ENABLE_WEATHER', 'true'
def buildSuffix = getBuildSuffix(versionName, versionCode)
applicationVariants.all { variant ->
def file = variant.outputs[0].outputFile
variant.outputs[0].outputFile = new File(file.parent, file.name.replace(".apk", "-" + buildSuffix + ".apk"))
}
}
if (project.hasProperty('signingKeyStoreFile')) {
signingConfigs {
release {
storeFile file(signingKeyStoreFile)
storePassword signingKeyStorePassword
keyAlias signingKeyAlias
keyPassword signingKeyPassword
}
}
}
buildTypes {
release {
minifyEnabled true
proguardFile 'proguard-project.txt'
if (project.hasProperty('signingKeyStoreFile')) {
signingConfig signingConfigs.release
}
}
}
lintOptions {
abortOnError false
checkReleaseBuilds false
disable 'MissingTranslation'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
def getBuildSuffix(versionName, versionCode) {
def suffix = versionName + '-' + versionCode
if (System.getenv()['BUILD_NUMBER'] != null) {
suffix += '-b' + System.getenv()['BUILD_NUMBER']
}
return suffix
}
def getBuildTag() {
def tag = ''
if (System.getenv()['BUILD_NUMBER'] != null) {
tag += 'b' + System.getenv()['BUILD_NUMBER']
} else {
tag += 'l'
}
tag += '@' + new Date().format('yyyyMMdd')
return tag
}
def getOpenWeatherMapApiKey() {
if (project.hasProperty('owmApiKey')) {
return owmApiKey
} else {
def apiKeyFile = file('default_owm_api_key');
if (apiKeyFile.isFile()) {
return apiKeyFile.text.trim()
}
}
return 'NOKEY'
}
///////////////////////////////////////////////////
// Dependencies
repositories {
mavenCentral()
}
dependencies {
//compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
//compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.code.gson:gson:2.3.1'
compile 'net.danlew:android.joda:2.9.4.1'
compile 'com.google.android.gms:play-services-ads:9.8.0'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
}
configurations {
all*.exclude group: 'com.google.firebase', module: 'firebase-core'
all*.exclude group: 'com.google.firebase', module: 'firebase-iid'
}
///////////////////////////////////////////////////
// Checkstyle
task checkstyleDebug(type: Checkstyle, dependsOn: 'compileDebugSources') {
source = fileTree('src/main/java/')
classpath = files('build/intermediates/classes/debug')
}
check.dependsOn checkstyleDebug
///////////////////////////////////////////////////
// Findbugs
task findbugsDebug(type: FindBugs, dependsOn: 'compileDebugSources') {
source = fileTree('src/main/java/')
classes = fileTree('build/intermediates/classes/debug')
classpath = files() // empty classpath!
effort = 'max'
excludeFilter = rootProject.file('config/findbugs/androidExcludeFilter.xml')
}
check.dependsOn findbugsDebug
///////////////////////////////////////////////////
// PMD
task pmd(type: Pmd) {
source = fileTree('src/main/java/')
ruleSets = ['java-basic', 'java-braces', 'java-android']
}
check.dependsOn 'pmd'