小编Mor*_*itz的帖子

Android studio:无法访问 androidx.core.view.MenuHost 的 MenuHost 类文件

我在构建项目时遇到错误。这是我的错误消息:无法访问未找到 androidx.core.view.MenuHost 的 MenuHost 类文件。

我没有找到解决这个问题的方法。如果你能帮助我,我会很高兴。我在空活动中遇到此错误:

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

public class CallActivity extends AppCompatActivity {
    /* Access modifiers changed, original: protected */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView( R.layout.activity_call);
    }
}

Run Code Online (Sandbox Code Playgroud)

这是我的 build.gradle (应用程序):

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

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"


    defaultConfig {
        applicationId "com.example.ghostcontact"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        // Enabling multidex support.
        multiDexEnabled true


        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"


    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    buildTypes {
        release { …
Run Code Online (Sandbox Code Playgroud)

java build androidx

5
推荐指数
3
解决办法
6013
查看次数

标签 统计

androidx ×1

build ×1

java ×1