gpt4 book ai didi

android - 无法实例化一个或多个类 Android Studio

转载 作者:行者123 更新时间:2023-11-29 16:40:44 25 4
gpt4 key购买 nike

enter image description here

我绝对是 android studio 的初学者。我试图在工作室中使用“基本布局”创建我的第一个应用程序并面临上述问题。实际问题是右下角没有 float 按钮,中间应该是“Hello World”的文本不存在,而是显示消息“android...CoordinatorLayoutStyle ".

我确实尝试了在互联网上找到的所有解决方案,并多次重新安装工作室。当没有任何效果时,我格式化了整个电脑并重新安装。但没有任何效果。我尝试在具有相同配置的其他 PC 上安装工作室。它工作正常。

我是这方面的绝对初学者,所以任何帮助的人都请解释一切

这是我的gradle文件

apply plugin: 'com.android.application'

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

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:design:28.0.0-alpha3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

最佳答案

尝试改用 SDK 27。

compileSdkVersiontargetSdkVersion改为27,然后将appcompat库版本从28.0.0-alpha3改为27.1.1

implementation 'com.android.support:appcompat-v7:27.1.1'

implementation 'com.android.support:design:27.1.1'

卸载 SDK 管理器中的 SDK 28 以及 SDK 工具选项卡中的版本 28 构建工具,将阻止 Android Studio 为新项目默认使用 SDK 28。

关于android - 无法实例化一个或多个类 Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50786369/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com