Jam*_*son 101 java apache android
在最近更新Android Studio之后,我们在编译以前工作的项目时遇到了问题.起初我们收到以下错误:
/Users/james/Development/AndroidProjects/myapp/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/res/values-v23/values-v23.xml
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Run Code Online (Sandbox Code Playgroud)
我将gradle文件中的sdk构建目标更新为23,这使得这个特定问题消失了,但它给我们留下了大量的apache.http包错误(具体来说,我们用于http内容的大量apache包现在已经不见了在sdk 23).
我想要做的是解决奇怪的资源错误,但没有更新到sdk 23.我现在没有时间重新编写我们的工具库来使用已发布的apache http组件的任何新实现.有没有人有任何想法?
Rob*_* B. 197
您需要将compileSdkVersion设置为23.
由于API 23 Android删除了已弃用的Apache Http软件包,因此如果您将它们用于服务器请求,则需要useLibrary 'org.apache.http.legacy'按照此链接中的说明添加到build.gradle :
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
...
//only if you use Apache packages
useLibrary 'org.apache.http.legacy'
}
Run Code Online (Sandbox Code Playgroud)
Tun*_*nga 78
将build.gradle文件中的appcompat版本更改回22.2.1(或之前使用的任何内容).
urn*_*ish 21
在你的项目build.gradle文件...写如下..我通过将appcompat版本从v7.23.0.0更改为v7.22.2.1解决了该错误..
dependencies
Run Code Online (Sandbox Code Playgroud)
{
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
Run Code Online (Sandbox Code Playgroud)
}
小智 10
注意,错误的答案来了!但是没有apache库的人可能会发现
compileSdkVersion 23
buildToolsVersion "23.0.0"
//...
dependencies {
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
}
Run Code Online (Sandbox Code Playgroud)
很有帮助,它为我做了诀窍.
| 归档时间: |
|
| 查看次数: |
122098 次 |
| 最近记录: |