【问题标题】:Flutter cant import `flutter_webrtc.dart`颤振无法导入`flutter_webrtc.dart`
【发布时间】:2021-02-17 05:06:39
【问题描述】:

为什么我无法导入flutter_webrtc.dart?这是我关注的文档https://pub.dev/packages/flutter_webrtc

home.dart

import 'package:flutter_webrtc/flutter_webrtc.dart';

pubspec.yaml

dependencies:
  http: ^0.12.2
  flutter_section_table_view: ^1.0.3
  page_transition: ^1.1.7+6
  path_provider: ^1.6.24
  cupertino_icons: ^1.0.0
  flutter_webrtc: ^0.5.8
  flutter:
    sdk: flutter

错误提示

C:\Users\Users\AndroidStudioProjects\TossGame\android\app\src\debug\AndroidManifest.xml Error:
    uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:flutter_webrtc] C:\Users\Users\AndroidStudioProjects\TossGame\build\flutter_webrtc\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 21,
        or use tools:overrideLibrary="com.cloudwebrtc.webrtc" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:flutter_webrtc] C:\Users\Users\AndroidStudioProjects\TossGame\build\flutter_webrtc\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 21,
        or use tools:overrideLibrary="com.cloudwebrtc.webrtc" to force usage (may lead to runtime failures)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 18s
Exception: Gradle task assembleDebug failed with exit code 1

【问题讨论】:

  • @JanviPatel 我已经投票了
  • 那是我的

标签: flutter dart


【解决方案1】:

minSdkVersion 设置为21。您可以在build.gradle 中找到它,它将解决您的问题。

【讨论】:

  • 是的,您可以查看您的环聊消息框。
【解决方案2】:

需要minSdkversion 21 改变app级build.gradle文件中的minSdkVersion=21

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-26
    • 2021-03-21
    • 2019-10-31
    • 2020-02-07
    • 2020-12-12
    • 2020-02-12
    • 2019-05-03
    • 1970-01-01
    相关资源
    最近更新 更多