我的Flutter版本:Flutter 3.0.0分级版本:分级7.2
当我在终端中运行.../android$ ./gradlew clean
,然后运行.../android$ ./gradlew build -warning-mode all
时,我得到以下错误:
> Task :share_plus:lintDebug FAILED
Lint found 4 errors, 3 warnings. First failure:
/home/my-name/.pub-cache/hosted/pub.dartlang.org/share_plus-6.2.0/android/src/main/kotlin/dev/fluttercommunity/plus/share/Share.kt:68: Error: Call requires API level 22 (current min is 16): android.content.Intent#createChooser [NewApi]
Intent.createChooser(
我更改了minSdkVersion,如下所示,但它仍然不工作。
安卓/应用程序/构建版本.gradle:
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.citymarker"
minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
targetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger()
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
安卓系统local.properties:
sdk.dir=/home/my-name/Android/Sdk
flutter.sdk=/home/thiago/development/flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
flutter.minSdkVersion=23
flutter.targetSdkVersion=33
flutter.compileSdkVersion=33
我试了所有能试的方法,但都不管用。
1条答案
按热度按时间z18hc3ub1#
我用一个较低版本的share_plus插件解决了这个问题。只需在pubspec.yaml中的依赖项下添加下面一行:
共享附加:4.0.2
我还不知道为什么即使在将minSdkVersion更改为23后仍会发生错误。如果有人有答案,请与我们分享。