Android 为什么我会得到:“我会得到什么?”;“保存库存是私人的”;错误

Android 为什么我会得到:“我会得到什么?”;“保存库存是私人的”;错误,android,android-studio,Android,Android Studio,我接受了我的一个老android项目,它是几年前在EclipseLuna上开发的,并试图恢复它 我已经把它导入了android studio,我被告知它可以转换成自己的格式,我可以继续工作 在抛出所有初始链接和版本兼容性错误后,我遇到了以下错误,无法通过: c:\....\MyProjectFolder\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:643: error:

我接受了我的一个老android项目,它是几年前在EclipseLuna上开发的,并试图恢复它

我已经把它导入了android studio,我被告知它可以转换成自己的格式,我可以继续工作

在抛出所有初始链接和版本兼容性错误后,我遇到了以下错误,无法通过:

c:\....\MyProjectFolder\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:643: error: resource android:attr/preserveIconSpacing is private.
有没有办法解决这个问题,或者这是一个合法的错误

这是我的身材。格雷德尔:

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')
}
只需清除解决方案: 借助Mohsenbellow的答案,该错误的解决方案是:

  • 我已经更改了build.gradle的内容,遵循了Mohsen的回答,更新了旧的依赖项并将编译更改为实现-错误消失了
  • 我已经按照解决方案消除了第二个错误(ResourceInteger/google\u play\u services\u版本)-请参见下文
  • 我现在有第三个错误,但似乎与第一个错误无关,因此我相信主要问题已经解决

    xml:643:error:resource
    android:attr/preserveIconSpacing
    is 私人的

    您正在使用一个私有资源,这就是这个问题出现的原因

    注释该行或删除该行将有助于继续


    更新:这是更改后的
    版本。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月8日),也许您应该用最新的依赖项替换它们

    例如,添加:

    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    
    而不是编译文件('libs/universal-image-loader-1.9.2.jar'),因为它可以从在线存储库下载库,您不需要手动添加它们

    也可以使用
    实现
    而不是
    编译


    如果错误仍然出现,请检查此链接并以这种方式添加简单的xml:

    就是这样,属性“preserveIconSpacing”不是我的。它可能是自动生成的或带有模板。您可以搜索它。搜索整个项目并尝试删除
    build
    目录。然后再次重建项目以查看结果。另外,请查看此链接:感谢您的帮助(Mohsen;)。我已经删除了构建并重建了项目-不走运。你链接的线程也没有给出有效答案..请检查我的更新答案。那些都很旧了。不奇怪。是的,那个错误似乎已经消失了。检查这个链接:它正在寻找一个找不到的整数。我得说。感谢您遵守社区规则。:)请让我知道,如果你创建了另一个问题与任何问题,以便我可以帮助你。