今天发现了一个报错的地方,在导用包的时候出现了一个引用类出错的现象
找到build.gradle在buildTypes中添加respositories,设置
repositories { maven { url "https://maven.google.com" } }
在后面加一个就行,源码是这样的
apply plugin: 'com.android.application' android { compileSdkVersion 28 buildToolsVersion "29.0.3" defaultConfig { applicationId "com.example.notebook" minSdkVersion 15 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' } repositories { maven { url "https://maven.google.com" } } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.13' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' implementation 'com.google.android.material:material:1.1.0' implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:appcompat-v7:28.0.0' }