我尝试使用此dependency但运行时出错:

flutter packages get

添加依赖项后
dependencies:
  flutter:
    sdk: flutter
  flutter_oauth: "^0.0.1"

错误:
The current Dart SDK version is 2.3.0-dev.0.5.flutter-a1668566e5.

Because flutter_app depends on flutter_oauth any which requires SDK version >=1.8.0 <2.0.0, version solving failed.
pub get failed (1)
exit code 1

我觉得我需要更改一些环境设置,但我不太确定如何更改:
environment:
  sdk: ">=2.1.0 <3.0.0"

更新:我按照建议使用了新的依赖项:flutter_generic_oauth:^1.0.2,并在Android Studio模拟器上运行应用程序时收到此错误:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.3.5\android\src\main\java\com\flutter_webview_plugin\WebviewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
D8: Program type already present: android.support.v4.app.INotificationSideChannel

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\6.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\7.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\8.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\9.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\10.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\11.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\12.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\13.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\14.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\15.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\16.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\17.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\18.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\19.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\20.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\21.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\22.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\23.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\24.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\25.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\26.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\27.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\28.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\29.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\30.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\31.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\32.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\33.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\34.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\35.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\36.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\37.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\38.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\39.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\40.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\41.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\42.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\43.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\44.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\45.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\46.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\47.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\48.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\49.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\50.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\51.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\52.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\53.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\54.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\55.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\56.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\57.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\58.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\59.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\60.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\61.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\62.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\63.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\64.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\65.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\66.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\68.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\69.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\70.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\72.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\73.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\74.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\75.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\76.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\77.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\78.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\79.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\80.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\81.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\82.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\83.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\84.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\85.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\86.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\87.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\88.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\89.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\90.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\91.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\92.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\93.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\94.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\95.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\96.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\97.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\98.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\99.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\100.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\101.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\102.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\103.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\104.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\105.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\106.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\107.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\108.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\109.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\110.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\111.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\112.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\113.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\114.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\115.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\116.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\117.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\118.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\119.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\120.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\121.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\122.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\123.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\124.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\125.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\126.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\127.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\128.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\129.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\130.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\131.jar, D:\garuda-academy\garuda_academy_app\build\app\intermediates\transforms\dexBuilder\debug\132.jar
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: android.support.v4.app.INotificationSideChannel

* 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 17s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See goo.gl/CP92wY for more information on the problem and how to fix it.
*******************************************************************************************
Finished with error: Gradle task assembleDebug failed with exit code 1

最佳答案

那个包裹还没有更新到DART 2.0。使用flutter_generic_oauth代替。
您需要convert your project to AndroidX

关于android - 由于SDK,flutter_oauth的版本解决失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56178443/

10-10 09:51