简体   繁体   English

迁移到API 23

[英]Migrating to API 23

My android application currently with API 22: 我目前使用API​​ 22的android应用程序:

compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
    minSdkVersion 14
    targetSdkVersion 22
}
dependencies {
.......
compile 'com.android.support:support-v4:22.2.1'
.......

} }

I would like to make a migration to API 23: 我想迁移到API 23:

compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
    minSdkVersion 14
    targetSdkVersion 22
}
dependencies {
    .......
    compile 'com.android.support:support-v4:23.0.1'
    .......
}

So basically i need to keep my old version of targetSdkVersion 22 for the reason to test some difference in permissions, but when i'm doing this it gives me error of compilation 所以基本上我需要保留我的旧版本的targetSdkVersion 22 ,以便测试权限上的某些差异,但是当我这样做时,它给了我编译错误

....\build\intermediates\res\merged\debug\values-v23\values-v23.xml
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(18) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

Question : Is it possible to keep targetSdkVersion 22? 问题 :是否可以保留targetSdkVersion 22?

You dont need to keep targetSdkVersion 22. Android allows managing runtime permission systems via adb tool official doc . 您不需要保留targetSdkVersion22。Android允许通过adb工具官方文档来管理运行时权限系统。

Related part from the doc 文档相关部分 在此处输入图片说明

Thank you guys for brainstorm - it works finally(code 18). 谢谢大家的集思广益-终于奏效了(代码18)。 Detailed check of all details gives a correct build. 详细检查所有细节将给出正确的构建。

compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
    minSdkVersion 14
    targetSdkVersion 22
    // Enabling multidex support.
    multiDexEnabled true
}

.... compile 'com.android.support:support-v4:23.0.1'

The reason of using targetSdkVersion 22 is to see the difference between PermissionChecker.checkSelfPermission and context.checkSelfPermission 使用targetSdkVersion 22的原因是为了查看PermissionChecker.checkSelfPermissioncontext.checkSelfPermission之间的区别

It looks like the problem is somewhere else because I made my gradle file look the same as your and I had no problems. 看来问题出在其他地方,因为我使gradle文件看起来与您的相同,并且我没有任何问题。 Have you seen this post: https://stackoverflow.com/a/26449172/5433709 ? 您是否看到过这篇文章: https : //stackoverflow.com/a/26449172/5433709

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM