android源代码中的问题,如何解决?

时间:2018-07-05 05:02:55

标签: android android-studio

enter image description here我正在android Studio 3.1 Canary 4中工作。突然我收到此问题“错误:(252,5)属性“类型”已使用不兼容的格式定义。”。我该如何解决这个问题。

我在这里附上了Logcat, enter image description here

现在正在更改SDK版本27,但是会出现相同的问题。 App Gradle,

set

}

国家/地区代码选择器gradle: enter image description here

Slidedatepicker gradle, enter image description here

2 个答案:

答案 0 :(得分:3)

只是为了清楚起见。

您正在使用同一库的不同版本,因此请更改以下内容:

compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:support-annotations:24.2.0'
compile 'com.android.support:design:24.2.1'

收件人:

compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:support-annotations:27.0.2'
compile 'com.android.support:design:27.0.2'

此外,如果其他一些库使用不同的版本,则会导致相同的问题。


另一件事,compile是多余的,您应该使用implementation

因此,它实际上应该是:

implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:support-annotations:27.0.2'
implementation 'com.android.support:design:27.0.2'

答案 1 :(得分:-2)

1. compile 'com.android.support:appcompat-v7:25.0.1'
2. compile 'com.android.support:design:25.0.1'

添加两个依赖项可能会有所帮助。