在Android Studio

时间:2016-03-17 18:34:04

标签: android retrofit

我是改造的新手,我在我的项目中使用了改造,这对于我所需的所有设备版本来说都很好。但是在我的项目中添加了一个库模块之后,它只能在更高的版本上运行,比如22 v,并提示错误:

    Could not find class 'retrofit.Utils$SynchronousExecutor', referenced          
    from method retrofit.RestAdapter$Builder.setExecutors

    java.lang.NoClassDefFoundError: retrofit.RestAdapter$LogLevel

在14 v。

等较低版本上

我的app gradle是:

 apply plugin: 'com.android.application'

 android {
compileSdkVersion 23
buildToolsVersion '23.0.2'

defaultConfig {
    applicationId "com.risingkashmir"
    minSdkVersion 14
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    multiDexEnabled true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
 }

 dependencies {
//   compile fileTree(dir: 'libs', include: ['*.jar'])
//    compile 'com.android.support:support-v4:22.0.0'
//noinspection GradleDependency
 compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.nineoldandroids:library:2.4.0'
compile project(':library')
compile files('libs/universal-image-loader-1.9.4.jar')
compile 'com.android.support:cardview-v7:23.1.1'
 compile 'com.google.android.gms:play-services:8.4.0'
compile project(':librarymenu')
}

我的图书馆Gradle是:

    apply plugin: 'com.android.library'

 android {
  compileSdkVersion 23
  buildToolsVersion "23.0.2"

  defaultConfig {
    minSdkVersion 14
    targetSdkVersion 22
    versionCode 1
    versionName "v0.1L"
 }
 buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
     }
  }
 }

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//    compile 'com.balysv:material-ripple:1.+'
//    compile 'com.squareup.retrofit:retrofit:1.9.0'

compile 'com.android.support:design:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:appcompat-v7:23.2.0'
}

0 个答案:

没有答案