ProGuard模糊了类名称无效

时间:2017-12-05 14:42:24

标签: android proguard

我知道有一些类不应该被混淆,但我希望其他类重命名为适配器,实用程序等。我现在无法让项目运行。

Gradle文件:

buildscript {
  repositories {
    maven { url 'https://maven.fabric.io/public' }
  }

  dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
  }
}
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric'

repositories {
  jcenter()
  maven { url 'https://maven.fabric.io/public' }
  maven { url "https://jitpack.io" }
}


android {
  compileSdkVersion 23
  buildToolsVersion "23.0.2"
  useLibrary 'org.apache.http.legacy'

  defaultConfig {
    multiDexEnabled true
    applicationId "com.afaqy.gps"
    minSdkVersion 15
    targetSdkVersion 17
    versionCode 39
    versionName "2.10"
    generatedDensities = []
  }
  buildTypes {
    release {
        minifyEnabled true
        debuggable false
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        debuggable false
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }

  lintOptions {
    abortOnError false
    checkReleaseBuilds false
  }

  dexOptions {
    javaMaxHeapSize "4g" //specify the heap size for the dex process
  }

  // This is handled for you by the 2.0+ Gradle Plugin
  aaptOptions {
    additionalParameters "--no-version-vectors"
  }
}

dependencies {
  compile 'com.google.code.gson:gson:2.2.4'
  compile 'com.android.volley:volley:1.0.0'
  compile 'com.jakewharton:disklrucache:2.0.2'
  compile 'com.android.support:appcompat-v7:23.0.0'
  compile 'com.android.support:cardview-v7:23.0.0'
  compile 'com.baoyz.pullrefreshlayout:library:1.2.0'
  compile project(':_LibSlideDateTimePicker')
  compile('io.socket:socket.io-client:0.6.3') {
    exclude group: 'org.json', module: 'json'
  }
  compile 'com.splitwise:tokenautocomplete:2.0.8@aar'
  compile 'com.squareup.picasso:picasso:2.5.2'
  compile 'com.google.firebase:firebase-messaging:9.4.0'
  compile 'com.github.paolorotolo:appintro:4.1.0'
  compile 'com.wang.avi:library:2.1.3'
  compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true;
  }
  compile 'com.android.support:recyclerview-v7:23.1.1'
  compile 'pl.bclogic:pulsator4droid:1.0.3'
  compile 'com.android.support:multidex:1.0.1'
  compile 'com.kyleduo.switchbutton:library:1.4.6'
  compile 'com.android.support:design:23.0.0'
  compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
  compile 'com.android.support:support-v4:23.+'
  compile 'com.daimajia.swipelayout:library:1.2.0@aar'
  compile 'me.leolin:ShortcutBadger:1.1.18@aar'
  compile 'su.j2e:rv-joiner:1.0.9'
  compile 'ca.barrenechea.header-decor:header-decor:0.2.8'
}
apply plugin: 'com.google.gms.google-services'

顶级构建文件

buildscript {
   repositories {
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
    classpath 'com.google.gms:google-services:3.0.0'
    classpath 'io.fabric.tools:gradle:1.+'
  }
}

allprojects {
  repositories {
    jcenter()
  }
}

proguard-rules.pro(#only okio能够生成签名的apk)

-dontwarn okio.**

同样在库的gradle我在buildTypes中使用它。

consumerProguardFiles 'proguard-rules.pro'

使用原始名称检索所有类。

知道我做错了什么吗?我在配置文件中错过了哪些不会混淆类名?

1 个答案:

答案 0 :(得分:0)

通过更新应用程序简介库修复 编译'com.github.paolorotolo:appintro:4.1.0' 至 编译'com.github.apl-devs:appintro:v4.2.2'