【发布时间】:2021-08-21 19:01:51
【问题描述】:
视图突然停止在 Android Studio 的设计模式下显示(包括“hello world”textView)。我没有更新任何东西或改变任何东西。 我尝试了以下解决方案:
- (换主题)This view is not constrained android studio. I can not see the button even if I use Infer Constraints
- 推断约束。
- (找不到链接)但标记为正确的答案说我的 SDK 已损坏 -> 更新它不起作用。 我怀疑 Gradle 是罪魁祸首,所以这里是应用程序的构建脚本(一个全新的项目):
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.cc.take6"
minSdkVersion 28
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
我的 android Studio 是版本:3.6.3。 有任何想法吗?提前谢谢你。
【问题讨论】: