Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 从';编译';至';实施';给出了路径列表错误_Android_Gradle_Android Gradle Plugin - Fatal编程技术网

Android 从';编译';至';实施';给出了路径列表错误

Android 从';编译';至';实施';给出了路径列表错误,android,gradle,android-gradle-plugin,Android,Gradle,Android Gradle Plugin,我正在尝试更新依赖项以使用新的实现/api规范,而不是编译。这是我正在编写的一个通用库,然后通过jitpack在我的应用程序中使用 在我的应用程序中使用库时,当我简单地从编译切换到实现时,我得到以下错误(只是重要的部分): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bumptech/glide/request/RequestOptions; Caused by: java.lang.ClassNotFoundExcep

我正在尝试更新依赖项以使用新的实现/api规范,而不是编译。这是我正在编写的一个通用库,然后通过jitpack在我的应用程序中使用

在我的应用程序中使用库时,当我简单地从编译切换到实现时,我得到以下错误(只是重要的部分):

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bumptech/glide/request/RequestOptions;

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.bumptech.glide.request.RequestOptions" on path: DexPathList
我尝试过清理和重建,但没有帮助。第二次我切换回编译调用一切正常

我会注意到,在所有情况下,库都可以正常构建

以下用法有效(尽管警告我compile将被弃用):

下面给出了上述错误(如果我使用api而不是实现,也会给出错误):


我还想补充一点,如果我只是将glide切换到compile,那么它会给出相同的错误,但会产生不同的依赖关系。有人能帮我弄清楚吗?我现在可以继续编译,但我想更新它。

经过几个小时的调试,我终于找到了答案

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
将我的库中的maven gradle插件从1.5更新到2.1解决了这个问题

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.12'
    implementation 'com.github.ybq:Android-SpinKit:1.2.0'
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation "com.github.bumptech.glide:glide:4.4.0"
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation "com.github.chrisbanes:PhotoView:1.3.1"
    implementation 'com.google.android.material:material:1.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'