weixin_39125267 2018-03-12 03:44 采纳率: 0%
浏览 1305
已采纳

android studio 关于jar包问题 不知道怎么解决

apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
useLibrary 'org.apache.http.legacy'

defaultConfig {
    applicationId "com.mynj"
    minSdkVersion 16
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }

}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.2'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'

compile 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'

compile 'com.squareup.picasso:picasso:2.5.1'
compile 'com.github.bumptech.glide:glide:3.5.2'

}

运行之后报错

Gradle build finished with 186 error(s) in 1m 39s 514ms

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.mysql.jdbc.ConnectionImpl$1) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is not an inner class.
Error:(com.mysql.jdbc.ConnectionImpl$10) that doesn't come with an
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:indicate that it is not an inner class.
Error:(com.mysql.jdbc.ConnectionImpl$2) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is not an inner class.
Error:(com.mysql.jdbc.ConnectionImpl$3) that doesn't come with an
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is not an inner class.

  • 写回答

2条回答

  • feihaokui 2018-03-12 03:56
    关注

    我试过的方法:
    #保留Annotation不混淆
    -keepattributes Annotation,InnerClasses,EnclosingMethod
    或者这样
    首先修改Gradle配置文件,启用MultiDex并包含MultiDex支持:

    defaultConfig {
    multiDexEnabled true
    }

    dependencies { compile 'com.android.support:multidex:1.0.1' }

    然后让应用支持多DEX文件。在MultiDexApplication JavaDoc中描述了三种可选方法:

    1、在AndroidManifest.xml的application中声明android.support.multidex.MultiDexApplication;
    2、如果你已经有自己的Application类,让其继承MultiDexApplication;
    3、如果你的Application类已经继承自其它类,你不想修改它,那么可以重写attachBaseContext()方法:

     @Override   
    protected void attachBaseContext(Context base) {  
        super.attachBaseContext(base); MultiDex.install(this);  
    }  
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题