支持库未导入

时间:2019-07-10 19:27:26

标签: java android

我无法导入支持库,现在仅导入:

import androidx.fragment.app.Fragment;
import android.app.Fragment; 

Google,我意识到了androidx。取代支持。但是问题仍然存在。

android {
    compileSdkVersion 28
    buildToolsVersion "29.0.0"
    defaultConfig {
        applicationId "com.example.criminalintent"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    ...
    implementation 'com.android.support:appcompat-v7:28.0.0'

需要:

import android.support.v4.app.Fragment;

1 个答案:

答案 0 :(得分:0)

尝试一下:

dependencies {
... //other 
implementation 'androidx.appcompat:appcompat:1.0.2'
}

使用AndroidX代替支持库。

相关问题