如何解决将 minSdkVersion 从 16 更新到 19 后,未找到 com.android.library 错误?
我通过编辑 minSdkVersion
文件将我的项目的 android/app/build.gradle
更新为 19
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.wallpaper"
minSdkVersion 19
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
而我的 android/build.gradle
文件是,
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
但是当我执行 flutter run
时出现以下错误。
FAILURE: Build failed with an exception.
* Where:
Build file '/home/ubuntu/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_compress-1.0.0/android/build.gradle' line: 23
* What went wrong:
A problem occurred evaluating root project 'flutter_image_compress'.
> Plugin with id 'com.android.library' not found.
BUILD FAILED in 19s
2
Exception: The plugin flutter_image_compress could not be built due to the issue above.
错误的原因是什么?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。