【发布时间】:2020-04-15 22:43:52
【问题描述】:
这是我的第一篇文章,但我需要一些帮助, 这是我的错误:
error: package android.support.design.widget does not exist
import android.support.design.widget.FloatingActionButton;
这是我的毕业代码
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.weatherviewerappeliasshahsamand"
minSdkVersion 23
targetSdkVersion 29
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(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
implementation 'com.google.android.material:material:1.2.0-alpha06'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
}
【问题讨论】:
-
我以为素材库没有下载。您对 build.gradle 进行一些更改,然后按“同步”,可能会解决您的问题。