相关疑难解决方法(0)

我可以使用Android支持androidx项目的库吗?

我知道,androidx和支持依赖导致multidex错误 我们不能同时使用androidx和android支持.所以我完全迁移到androidx.但我的一个依赖lib使用了android支持"lottie".

在上述情况下我们能做些什么?我应该从我的项目中删除'lottie'吗?

下面是我的傻瓜

defaultConfig {
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
    }

    ext{
    lottieVersion = "2.5.4"
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    def androidx = "1.0.0-rc01"
    api "androidx.constraintlayout:constraintlayout:1.1.2"
    api "androidx.appcompat:appcompat:$androidx"
    api "androidx.recyclerview:recyclerview:$androidx"
    api "androidx.cardview:cardview:$androidx"
    api "androidx.core:core-ktx:$androidx"
    api "com.google.android.material:material:1.0.0-rc01"
    implementation "com.google.code.gson:gson:2.8.5"
    implementation "androidx.multidex:multidex:2.0.0"
    implementation "com.airbnb.android:lottie:$lottieVersion"
    }
Run Code Online (Sandbox Code Playgroud)

android android-jetpack

63
推荐指数
4
解决办法
4万
查看次数

Android X:工具:替换为line:for属性,但没有指定新值

我在这个网站上尝试了很多解决方案,但问题仍未解决.问题是由于Android X库.当我添加Android X时,此问题已得到解决,但它开启了新问题.我不想添加Android X.如何解决这个问题?

早些时候这个错误即将来临:

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:19:5-142:19 to override.
Run Code Online (Sandbox Code Playgroud)

我添加后tools:replace="android:appComponentFactory",出现此错误:

 java.lang.RuntimeException: Manifest merger failed with multiple errors, see logs
at com.android.builder.core.AndroidBuilder.mergeManifestsForApplication(AndroidBuilder.java:540)    
at com.android.build.gradle.tasks.MergeManifests.doFullTaskAction(MergeManifests.java:173)
Run Code Online (Sandbox Code Playgroud)

合并错误(在Android Manifest中):

错误:工具:替换为line:2指定属性android:appComponentFactory,但没有指定新值的应用程序主清单(此文件),第1行

表现:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    package="com.example"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:replace="allowBackup, android:appComponentFactory"
    android:allowBackup="false">

    ...

    <application
        android:name="com.example"
        android:icon="@mipmap/icon"
        android:debuggable="true"
        android:hardwareAccelerated="false"
        android:largeHeap="true"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:allowBackup="false"
        tools:ignore="GoogleAppIndexingWarning,HardcodedDebugMode">
       ...
Run Code Online (Sandbox Code Playgroud)

模块级build.gradle中的依赖项块:

Manifest merger failed : Attribute …
Run Code Online (Sandbox Code Playgroud)

java android android-manifest android-gradle-plugin androidx

53
推荐指数
6
解决办法
5万
查看次数

清单合并失败:属性application @ appComponentFactory更新Firebase库

我正在尝试在我的项目中添加firebase,但是当我实现'com.google.firebase:firebase-messaging:19.0.0'and时'com.google.firebase:firebase-core:17.0.0'。

build.gradle(这是错误)

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
 compileSdkVersion 28
 defaultConfig {
    applicationId "com.example.user.mikripoli"
    minSdkVersion 15
    targetSdkVersion 28
    multiDexEnabled true
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
 "android.support.test.runner.AndroidJUnitRunner"
 }
 buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
 'proguard-rules.pro'
    }
 }

 dexOptions {
    javaMaxHeapSize "2g"
 }
}

dependencies {
 implementation 'com.roughike:bottom-bar:2.0'
 implementation 'com.android.support:support-v4:28.0.0'
 implementation 'com.android.support:exifinterface:28.0.0'
 implementation 'com.android.support:animated-vector-drawable:28.0.0'
 implementation 'com.flaviofaria:kenburnsview:1.0.7'
 implementation fileTree(include: ['*.jar'], dir: 'libs')
 implementation 'com.android.support:appcompat-v7:28.0.0'
 implementation 'com.android.support.constraint:constraint-layout:1.1.3'
 implementation 'com.android.support:design:28.0.0'
 implementation 'com.github.chrisbanes:PhotoView:2.1.4'
 implementation 'com.google.firebase:firebase-messaging:19.0.0'
 implementation 'com.google.firebase:firebase-core:17.0.0' …
Run Code Online (Sandbox Code Playgroud)

java gradle firebase build.gradle androidx

8
推荐指数
1
解决办法
4791
查看次数