为什么flutter_wallpaper_manager显示此错误?无法确定任务“:flutter_wallpaper_manager:compileDebugAidl”的依赖项

kfgdxczn  于 2023-01-02  发布在  Flutter
关注(0)|答案(1)|浏览(87)

我的应用\build.gradle文件概述

android {
compileSdkVersion 31
ndkVersion flutter.ndkVersion\

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
    jvmTarget = '1.8'
}

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.flt_firebase"
    // You can update the following values to match your application needs.
    // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
    minSdkVersion flutter.minSdkVersion
    targetSdkVersion flutter.targetSdkVersion
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    minSdkVersion 21
    targetSdkVersion 31
}

flutter_壁纸_管理器:^0.0.3 flutter缓存管理器:^3.3.0版本
'

Padding(
  padding: const EdgeInsets.symmetric(horizontal: 130),
  child: GestureDetector(
    onTap: () async{
      int location = WallpaperManager.BOTH_SCREEN;
      var file = await DefaultCacheManager().getSingleFile(imageurl[activeIndex]);
      final bool result =
          await WallpaperManager.setWallpaperFromFile(file.path, location);
    },

'
无法确定任务“:flutter_wallpaper_manager:compileDebugAidl”的依赖项。
未能找到以下路径的Platform SDK:平台;android-30
我正在制作基本的壁纸应用程序,我使用flutter_wallpaper_manager包和flutter_cache_manager,但它给了我这个运行时错误。

7eumitmz

7eumitmz1#

你只需要这么做

flutter clean
/// and
flutter pub get

或者不工作,那么你也可以下载Android 30平台。它的工作很好。

相关问题