我采用了我的一个旧的android项目,它是在几年前的eclipse露娜上开发的,并试图恢复它。
我已经把它导入了android工作室,有人告诉我可以将它转换成自己的格式,这样我就可以继续工作了。
在抛出所有初始链接和版本兼容性错误之后,我陷入了以下错误,无法传递它:
c:\....\MyProjectFolder\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:643: error: resource android:attr/preserveIconSpacing is private.有什么办法可以绕过这件事,还是说这是个合法的错误?
这是我的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.eibimalul.smartgallery"
minSdkVersion 16
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:gridlayout-v7:19.1.0'
compile 'com.android.support:appcompat-v7:19.1.0'
compile files('libs/robobinding-0.8.3-jar-with-dependencies.jar')
compile files('libs/simple-xml-2.7.1.jar')
compile files('libs/universal-image-loader-1.9.2.jar')
}只是为了清除解决方案:,在Mohsen bellow的回答的帮助下,这个错误的解决方案是:
我现在有第三个错误,但似乎与第一个错误无关,所以我认为主要问题已经解决。
发布于 2018-10-21 07:41:06
values.xml:643:错误:资源
android:attr/preserveIconSpacing是私有的。
您正在使用,这是一个私有资源,这就是出现这个问题的原因。
注释这一行或删除它将有助于继续进行。
更新:这里的是已更改的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.eibimalul.smartgallery"
minSdkVersion 16
targetSdkVersion 28
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
implementation 'com.android.support:gridlayout-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation files('libs/robobinding-0.8.3-jar-with-dependencies.jar')
implementation files('libs/simple-xml-2.7.1.jar')
implementation files('libs/universal-image-loader-1.9.2.jar')
}我只是简单地更改了appcompat和compileSdkVersion等的版本,以便更新它们。此外,如果这没有帮助,因为这些图书馆已经足够老(日期(2013年7月08 ))。也许您应该用最新的依赖项来替换它们。
例如,添加:
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'而不是compile files('libs/universal-image-loader-1.9.2.jar'),因为它可以从在线存储库下载库,您不需要手动添加它们。
也可以使用implementation而不是compile。
如果仍然出现错误,请检查此链接并以这种方式添加simple:https://stackoverflow.com/a/19455878/4409113。
https://stackoverflow.com/questions/52912763
复制相似问题