Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/336.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
Java 未能解析所有androidx库_Java_Android - Fatal编程技术网

Java 未能解析所有androidx库

Java 未能解析所有androidx库,java,android,Java,Android,我已经为房间数据库添加了库。这是一个androidX图书馆。我对库知之甚少(我是初学者),也不了解AndroidX。我发现了这些明显的合并错误,在重新搜索解决方案时,我发现了AndroidX库。所以我想将我的项目迁移到AndroidX,但AndroidStudio无法解析这些库中的任何一个 我的构建梯度(应用程序): 我的构建梯度(项目): 我的舱单: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=

我已经为房间数据库添加了库。这是一个androidX图书馆。我对库知之甚少(我是初学者),也不了解AndroidX。我发现了这些明显的合并错误,在重新搜索解决方案时,我发现了AndroidX库。所以我想将我的项目迁移到AndroidX,但AndroidStudio无法解析这些库中的任何一个

我的构建梯度(应用程序):

我的构建梯度(项目):

我的舱单:

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

    <application
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar">
        <activity android:name=".ui.activities.SplashActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.VIEW" />

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

</manifest>

尝试将这些添加到项目
build.gradle
文件中

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' }
        mavenCentral()
    }
    ...
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' }
    }
}
对于Kotlin DSL

repositories {
    maven { setUrl("https://maven.google.com") }
}

您是否在gradle设置中设置了useAndroidX=true和android.enableJetifier=true?
buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' }
        mavenCentral()
    }
    ...
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' }
    }
}
repositories {
    maven { setUrl("https://maven.google.com") }
}