Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 梯度误差_Android_Gradle_Manifest - Fatal编程技术网

Android 梯度误差

Android 梯度误差,android,gradle,manifest,Android,Gradle,Manifest,同步时出现渐变问题。 应用程序级渐变文件 Manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.aparna.search_recy"> <application android:allowBackup="true"

同步时出现渐变问题。 应用程序级渐变文件

Manifest.xml

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.aparna.search_recy">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
错误:

Error:Execution failed for task ':app:processDebugManifest'.
清单合并失败:属性元数据#android.support。VERSION@value值=(26.1.0)来自[com.android.support:support-v13:26.1.0]AndroidManifest.xml:28:13-35 也出现在[com.android.support:cardwiew-v7:26.0.2]AndroidManifest.xml:25:13-35 value=(26.0.2)上。 建议:在AndroidManifest.xml:26:9-28:38处的元素中添加'tools:replace=“android:value”'以覆盖


将您的
cardview-v7:26.0.2
版本更改为26.1.0

将您的
cardview-v7:26.0.2
版本更改为26.1.0

实际上,如果您在依赖项中使用不同的版本,则会出现此错误

要避免此错误,只需将cardview-v7:26.0.2版本更改为26.1.0


它将解决您的问题

实际上,如果您在依赖项中使用不同的版本,则会出现此错误

要避免此错误,只需将cardview-v7:26.0.2版本更改为26.1.0


它将解决您的问题

建议:在AndroidManifest.xml:26:9-28:38处的元素中添加'tools:replace=“android:value”'以覆盖


出现此问题的原因是,当您使用不同的库时,其中的AndroidManifest相互冲突。

建议:在AndroidManifest.xml:26:9-28:38处的元素中添加'tools:replace=“android:value”'以覆盖


出现此问题的原因是,当您使用不同的LIB时,其中的AndroidManifest会相互冲突。

首先,您可以在
compileSdkVersion
下面添加缺少的
buildToolVersion
,然后使用相同的版本 还缺少
compile'com.android.support:recyclerview-v7:
version,因此添加此 检查下面的代码

      android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1" //change here
    defaultConfig {
        applicationId "com.aparna.search_recy"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

     buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:support-v13:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.android.support:recyclerview-v7:26.1.0' //change here
    compile 'com.android.support:cardview-v7:26.1.0'
}
最后清理和重建项目
如果此操作不起作用,请转到
文件->使缓存无效/重新启动

首先,您可以在
编译器dkversion
下面添加缺少的
构建工具版本
,然后使用相同的版本 还缺少
compile'com.android.support:recyclerview-v7:
version,因此添加此 检查下面的代码

      android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1" //change here
    defaultConfig {
        applicationId "com.aparna.search_recy"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

     buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:support-v13:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.android.support:recyclerview-v7:26.1.0' //change here
    compile 'com.android.support:cardview-v7:26.1.0'
}
最后清理和重建项目
如果不起作用,请转到
文件->使缓存无效/重新启动

尝试这些组合。因为版本混合在依赖项中,这导致在构建gradle时运行时崩溃。
所有com.android.support库必须使用完全相同的版本规范。有些库、工具和库的组合不兼容或可能导致错误

用下面提到的依赖项替换依赖项

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    implementation 'com.android.support:cardview-v7:27.0.2'

试试这些组合。因为版本混合在依赖项中,这导致在构建gradle时运行时崩溃。
所有com.android.support库必须使用完全相同的版本规范。有些库、工具和库的组合不兼容或可能导致错误

用下面提到的依赖项替换依赖项

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    implementation 'com.android.support:cardview-v7:27.0.2'

只需将错误中的库添加到build.gradle中,但更改版本以匹配您正在使用的其他库

对我来说,我的build.gradle文件有以下内容:

implementation 'com.android.support:appcompat-v7:27.1.1'
我得到了这个错误:

清单合并失败:属性 元数据#android.support。VERSION@value值=(26.0.2)自 [com.android.support:recyclerview-v7:26.0.2] AndroidManifest.xml:25:13-35也出现在 [com.android.support:support-v4:26.1.0]AndroidManifest.xml:28:13-35 值=(26.1.0)。建议:将“tools:replace=“android:value””添加到 要重写的AndroidManifest.xml:23:9-25:38处的元素

因此,我在by build.gradle中添加了
recyclerview-v7:26.0.2
,但将其更改为27.1.1以匹配我的
appcompat-v7
。我再次构建了它,并得到了一个类似的错误,但这次是针对
com.android.support:percent:26.0.2

我再次将其添加到gradle.build文件中,但将其更改为27.1.1以匹配我的
appcompat-v7

总之,这:

implementation 'com.android.support:appcompat-v7:27.1.1'
变成这样

implementation 'com.android.support:appcompat-v7:27.1.1'
// Had to add recyclerview
implementation 'com.android.support:recyclerview-v7:27.1.1'
// Had to add percent
implementation 'com.android.support:percent:27.1.1'
然后它工作得很好


我猜
appcompat-v7
必须将这些旧版本的库硬编码到其中。

只需将错误中的库添加到build.gradle中,但更改版本以匹配您正在使用的其他库

对我来说,我的build.gradle文件有以下内容:

implementation 'com.android.support:appcompat-v7:27.1.1'
我得到了这个错误:

清单合并失败:属性 元数据#android.support。VERSION@value值=(26.0.2)自 [com.android.support:recyclerview-v7:26.0.2] AndroidManifest.xml:25:13-35也出现在 [com.android.support:support-v4:26.1.0]AndroidManifest.xml:28:13-35 值=(26.1.0)。建议:将“tools:replace=“android:value””添加到 要重写的AndroidManifest.xml:23:9-25:38处的元素

因此,我在by build.gradle中添加了
recyclerview-v7:26.0.2
,但将其更改为27.1.1以匹配我的
appcompat-v7
。我再次构建了它,并得到了一个类似的错误,但这次是针对
com.android.support:percent:26.0.2

我再次将其添加到gradle.build文件中,但将其更改为27.1.1以匹配我的
appcompat-v7

总之,这:

implementation 'com.android.support:appcompat-v7:27.1.1'
变成这样

implementation 'com.android.support:appcompat-v7:27.1.1'
// Had to add recyclerview
implementation 'com.android.support:recyclerview-v7:27.1.1'
// Had to add percent
implementation 'com.android.support:percent:27.1.1'
然后它工作得很好


我想appcompat-v7必须将那些旧版本的库硬编码到其中。

对于我启用jetifier和androidx解决了此错误

对于我启用jetifier和androidx解决了此错误

可以显示你的应用程序级别构建。gradle@QEMU我已经用我的应用程序级别gradleshare更新了我的问题androidmanifest.xml文件检查答案,它肯定会帮助您。只需将您的依赖项替换为我发布的内容。即可显示您的应用程序级版本。gradle@QEMU我已经用我的应用程序级别的gradleshare androidmanifest.xml文件更新了我的问题检查答案,它肯定会帮助你。请用我发布的内容替换你的依赖项。这个答案是错误特定的,并解释了它发生的原因。这个答案是错误特定的,带有解释