gpt4 book ai didi

android - 使用-sdk :minSdkVersion 16 cannot be smaller than version 23 declared in library [:audioplayers]

转载 作者:行者123 更新时间:2023-12-04 11:48:30 26 4
gpt4 key购买 nike

我正在用 flutter 、 Dart 和火焰创建一个简单的游戏,我的火焰更新版本与 flutter 一样,

C:\Users\Users\Desktop\vcflutter\flutter_application_1\lib\Flutter Game\flutter_application_1\android\app\src\debug\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 23 declared in library [:audioplayers] C:\Users\Users\Desktop\vcflutter\flutter_application_1\lib\Flutter Game\flutter_application_1\build\audioplayers\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 23,
or use tools:overrideLibrary="xyz.luan.audioplayers" to force usage (may lead to runtime failures)
我的 pubspec.yaml
version: 1.0.0+1

environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
flame: ^0.29.0
cupertino_icons: ^1.0.0

dev_dependencies:
flutter_test:
sdk: flutter
我的 main.dart
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flame/util.dart';
import 'package:flutter/services.dart';
import 'package:flutter_application_1/langaw-game.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
Util flameUtil = Util();
await flameUtil.fullScreen();
await flameUtil.setOrientation(DeviceOrientation.portraitUp);

LangawGame game = LangawGame();
runApp(game.widget);
}
langaw-game.dart
import 'dart:ui';
import 'package:flame/game.dart';

class LangawGame extends Game {
Size screenSize;
double tileSize;
@override
void render(Canvas canvas) {
Rect bgRect = Rect.fromLTWH(0, 0, screenSize.width, screenSize.height);
Paint bgPaint = Paint();
bgPaint.color = Color(0xff576574);
canvas.drawRect(bgRect, bgPaint);
}

@override
void update(double t) {}
@override
void resize(Size size) {
super.resize(size);
screenSize = size;
tileSize = screenSize.width / 9;
}
}
我在 youtube https://www.youtube.com/watch?v=N4LFV9_fLAo 中关注此文档

最佳答案

在您的 gradle 文件中,只需将 minSdkVersion 更新为 23

android {
compileSdkVersion 30
defaultConfig {
applicationId "com.oaics.customer"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"

}

关于android - 使用-sdk :minSdkVersion 16 cannot be smaller than version 23 declared in library [:audioplayers],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66167083/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com