Cannot access ActivityCompatApi23 class

人走茶凉 提交于 2019-11-29 14:05:49

You have declared compileSdkVersion equal to 25, whereas 0.3.1 version of flexbox layout uses support libs version 26.0.0 - that's a problem, compileSdkVersion should match support libs major version.

Either upgrade your project to 26 or use a version of flexbox layout that relies on sdk 25, which seems to be v0.2.7:

compile 'com.google.android:flexbox:0.2.7'

Like the Problem I meet。

When I Use Android Room like this :

compileSdkVersion 25 compile "android.arch.persistence.room:runtime:1.0.0"

I get the same Error.

Because compileSdkVersion should match support libs major version.

More Detail you can see this : Error in support lib after room persistence

Room depends on 26.1 of support library, which is probably why it is broken because SupportLibrary does not promise interop between versions.

Also, you can fix the problem use this

compile ("android.arch.persistence.room:runtime:1.0.0") {
                exclude group: 'com.android.support'
}
user1075359

use

compile 'com.android.support:appcompat-v7:26.1.0'

I just changed the line

compile 'com.android.support:appcompat-v7:26.0.0-alpha1'

to compile 'com.android.support:appcompat-v7:26.+'

and it worked for me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!