小编Abd*_*air的帖子

修复 Gradle 中的依赖解析错误

当我将 okhttp3 依赖从 3.4.1 更新到 4.1.0 时,我的项目无法构建并引发以下错误。

Duplicate class org.intellij.lang.annotations.Identifier found in modules annotations-12.0.jar     
(com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
Duplicate class org.intellij.lang.annotations.JdkConstants found in modules annotations-12.0.jar     
(com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules 
annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar       
(org.jetbrains:annotations:13.0)
Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules annotations-                              
12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)

Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules annotations- 
12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)

Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules annotations-   
12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)

Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found …
Run Code Online (Sandbox Code Playgroud)

android gradle android-gradle-plugin

6
推荐指数
2
解决办法
1万
查看次数

MutableList没有添加新值Kotlin

我从特定文件夹获取文件路径列表,但是当我尝试将其添加到我的可变列表中时,列表仍为空.

var filePath: MutableList<String>? = null
val path = File(getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).path, "BacFo Camera")
if (path.exists()) {
    for(i in path.list().iterator()){
        filePath?.add("" + path.toString() + "/" + i)  //here i=file name
    }
}
Run Code Online (Sandbox Code Playgroud)

在运行Debugger之后,值确实存在变量,i但有些可变列表保持为空.我是Kotlin的新手,请帮助!!

android kotlin mutablelist

1
推荐指数
1
解决办法
421
查看次数