首页 > 解决方案 > Android Studio 3.6.3:遵循关于如何制作音板的旧教程(错误:AlertController is not public in androidx.appcompat.app)

问题描述

我在学习本教程时遇到了问题。这是一个在 Android Studio 3.6.3 中制作 Soundboard 的教程

问题出在这行代码中:

import androidx.appcompat.app.AlertController;

这是错误:

error: AlertController is not public in androidx.appcompat.app; cannot be accessed from outside package 
import androidx.appcompat.app.AlertController;

可能问题出在这里:6:27,教程的创建者使用这个旧代码添加了 recyclerview 支持库:

compile: 'com.android.support:recyclerview-v7:23.4.0'

我改用这段代码:

    implementation "androidx.recyclerview:recyclerview:1.1.0"

有人可以帮我解决错误吗?

标签: android

解决方案


推荐阅读