Youtube_player_flutter: webview_flutterと競合します

作成日 2019年05月05日  ·  23コメント  ·  ソース: sarbagyastha/youtube_player_flutter

webview_flutteryoutube_player_flutterの両方を含めると、起動時にアプリケーションがクラッシュし、次の警告とエラーが発生します

objc[44664]: Class FLTCookieManager is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d8400) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb250). One of the two will be used. Which one is undefined.
objc[44664]: Class FLTWKNavigationDelegate is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d8450) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb2a0). One of the two will be used. Which one is undefined.
objc[44664]: Class FLTWebViewFactory is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d84a0) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb2f0). One of the two will be used. Which one is undefined.
objc[44664]: Class FLTWebViewController is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d84c8) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb318). One of the two will be used. Which one is undefined.
objc[44664]: Class FLTJavaScriptChannel is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d8540) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb390). One of the two will be used. Which one is undefined.
objc[44664]: Class FLTWebViewFlutterPlugin is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d85b8) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb458). One of the two will be used. Which one is undefined.
2019-05-04 09:20:00.568482+0700 Runner[44664:362412] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.
2019-05-04 09:20:00.844000+0700 Runner[44664:362412] You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.
2019-05-04 09:20:00.844196+0700 Runner[44664:362412] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
2019-05-04 09:20:00.845692+0700 Runner[44664:362412] *** Assertion failure in -[FlutterEngine registrarForPlugin:], ../../flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm:560
2019-05-04 09:20:00.917563+0700 Runner[44664:362412] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Duplicate plugin key: FLTWebViewFlutterPlugin'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010d4296fb __exceptionPreprocess + 331
    1   libobjc.A.dylib                     0x000000010c9cdac5 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010d429482 +[NSException raise:format:arguments:] + 98
    3   Foundation                          0x000000010c41b927 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
    4   Flutter                             0x000000010a5a3d6b -[FlutterEngine registrarForPlugin:] + 269
    5   Runner                              0x000000010a29be1e +[GeneratedPluginRegistrant registerWithRegistry:] + 174
    6   Runner                              0x000000010a29bf18 $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 168
    7   Runner                              0x000000010a29c254 $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtFTo + 196
    8   UIKitCore                           0x0000000116d3b311 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 280
    9   UIKitCore                           0x0000000116d3ccad -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3932
    10  UIKitCore                           0x0000000116d420c6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1617
    11  UIKitCore                           0x00000001165876d6 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 904
    12  UIKitCore                           0x000000011658ffce +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
    13  UIKitCore                           0x00000001165872ec -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
    14  UIKitCore                           0x0000000116587c48 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1091
    15  UIKitCore                           0x0000000116585fba __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 782
    16  UIKitCore                           0x0000000116585c71 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
    17  UIKitCore                           0x000000011658a9b6 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 576
    18  UIKitCore                           0x000000011658b610 _performActionsWithDelayForTransitionContext + 100
    19  UIKitCore                           0x000000011658a71d -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
    20  UIKitCore                           0x000000011658f6d0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
    21  UIKitCore                           0x0000000116d409a8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 514
    22  UIKitCore                           0x00000001168f7dfa -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
    23  FrontBoardServices                  0x0000000118d71125 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
    24  FrontBoardServices                  0x0000000118d7aed6 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 283
    25  FrontBoardServices                  0x0000000118d7a700 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53
    26  libdispatch.dylib                   0x0000000110db5db5 _dispatch_client_callout + 8
    27  libdispatch.dylib                   0x0000000110db92ba _dispatch_block_invoke_direct + 300
    28  FrontBoardServices                  0x0000000118dac146 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
    29  FrontBoardServices                  0x0000000118dabdfe -[FBSSerialQueue _performNext] + 451
    30  FrontBoardServices                  0x0000000118dac393 -[FBSSerialQueue _performNextFromRunLoopSource] + 42
    31  CoreFoundation                      0x000000010d390be1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    32  CoreFoundation                      0x000000010d390463 __CFRunLoopDoSources0 + 243
    33  CoreFoundation                      0x000000010d38ab1f __CFRunLoopRun + 1231
    34  CoreFoundation                      0x000000010d38a302 CFRunLoopRunSpecific + 626
    35  GraphicsServices                    0x0000000111ba92fe GSEventRunModal + 65
    36  UIKitCore                           0x0000000116d43ba2 UIApplicationMain + 140
    37  Runner                              0x000000010a29c3f8 main + 72
    38  libdyld.dylib                       0x0000000110e2a541 start + 1
    39  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

アプリケーションを実行できるようにするには、 webview_flutterを削除する必要がありました。

この問題は、シミュレーターを使用してiOSでのみテストしました。

fixed

最も参考になるコメント

YouTubeプレーヤープラグインは別のプラグインwebview_mediaを使用し、それはwebview_flutterプラグインを使用するため、インポート後に使用するとエラーがなくなるはずです

import'package:webview_media / webview_flutter.dart '

全てのコメント23件

関連する問題がAndroidで発生します。この場合、次の例外がスローされ、最初のフレームレンダリングの前にアプリケーションが終了します。
E/AndroidRuntime( 6955): java.lang.RuntimeException: Unable to start activity ComponentInfo{my.app/my.app.MainActivity}: java.lang.IllegalStateException: Plugin key io.flutter.plugins.webviewflutter.WebViewFlutterPlugin is already in use

応答が遅くなって申し訳ありません😐、このプラグインにはwebviewプラグインが組み込まれているため、webviewプラグインを個別に追加する必要はありません。

@sarbagyasthaしかし、私のアプリもWebビューを直接使用しています。 フォークされたバージョンを使用できますか?最新バージョンのwebview_flutterで最新の状態に保たれますか? このプラグインのwebview_flutterのフォークの変更をアップストリームにマージして、フォークが不要になるようにすることはできますか?

D8: Program type already present: io.flutter.plugins.webviewflutter.BuildConfig

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list:
  Error while merging dex archives: 
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: io.flutter.plugins.webviewflutter.BuildConfig

* 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 10s
Finished with error: Gradle task assembleDebug failed with exit code 1

私はアプリでwebview_flutter:^ 0.3.6を使用していますが、両方を使用すると上記のエラーが発生します。 そして、webview_flutter:^ 0.3.6を削除すると、アプリがそれを必要とするため、エラーが発生します。

@GeertJohanはい、フォークされたバージョンは、メジャーアップデートとパフォーマンスの向上のために最新の状態に保たれます。 はい、マージすることはできますが、マージするのに長い時間がかかります。現在、プロジェクト追跡には保留中のwebview_flutterPRが多数あります。

@Xoshbinは、今夜プラグインを更新します。ここで、組み込みのWebビューへのアクセスがエクスポートされます。

@sarbagyasthaありがとう私はそれを待ちます:)

バージョン1.1.1はこの問題に対処します。

まだ機能していません。依存関係からWebビューを削除してもエラーが発生します。追加すると、上記と同じエラーが発生します。

フルビルドを実行しましたか?
また、 flutter cleanを実行してみてください

はい、フルビルドを実行しました。$#$ 1 $#$の有無にかかわらずflutter clean webview_flutter

また、Android Studioを使用している場合は、キャッシュを無効にしてみてください。 または、 gradlew cleanを実行します。
これは、webview_flutterプラグインの残りが原因である可能性があります。

webview_flutterを依存関係に保持する必要がありますか、それとも削除する必要がありますか?

私もそうしましたが、まだ機能していません!

このインポートステートメントを使用して、組み込みのWebViewを使用できます

import 'package:ytview/ytview.dart';

これはReadmeファイルに記載する必要があると思います

@ Xoshbin @3acewebview_flutterを削除する必要があります。 そして最新のアップデートで
import 'package:youtube_player_flutter/youtube_player_flutter.dart';
WebViewウィジェットが含まれています。
これは、readmeの注セクションに記載されています。

@sarbagyasthaありがとうございます。

これについて、readmeで大きなメモをとっていただけますか?

また、 @ 3aceで指定されたインポートを追加しますか?

import'package:ytview / ytview.dart ';

これはデバッグが非常に難しい問題でした。

たぶん実際にreadmeにこのページへのリンクを追加しますか?

特にFlutterを初めて使用する人にとっては、既存のテキストはあまり明確ではないことがわかりました。

既存のテキスト:
_このプラグインには依存関係としてすでにwebviewが含まれているため、プラグインはwebview_flutterプラグインとの競合を引き起こします。 したがって、webview_flutterを個別に追加する必要はありません。 プラグイン自体からWebViewを使用できます。_

提案文:

webviewとの競合

次のような例外が発生する場合があります。
program type already present: io.flutter.plugins.webviewflutter
また
Plugin key io.flutter.plugins.webviewflutter.WebViewFlutterPlugin is already in use

このプラグインには依存関係としてすでにwebviewが含まれているため、プラグインはwebview_flutterプラグインとの競合を引き起こします。 したがって、webview_flutterを個別に追加する必要はありません。 プラグイン自体からWebViewを使用できます。

これの意味は:

  1. 削除/コメントアウト
dependencies:
  webview_flutter: ^0.3.0
  1. import 'package:ytview/ytview.dart';を使用します

    3.オプションで、詳細についてはこのチケットを参照してください

このテキストはどのように聞こえますか?

ちなみに、素晴らしい仕事をありがとう!

ありがとう! 素晴らしい仕事:smile_cat:

インポートするとき
import'package:youtube_player_flutter / youtube_player_flutter.dart ';
「webview_flutter:0.3.19 + 7」を削除し、すべてのパッケージをインストールして、フラッタークリーンにさえします-それは機能しません。

次のエラーがスローされます-メソッド「WebView」が定義されていません。

YouTubeプレーヤープラグインは別のプラグインwebview_mediaを使用し、それはwebview_flutterプラグインを使用するため、インポート後に使用するとエラーがなくなるはずです

import'package:webview_media / webview_flutter.dart '

import'package:webview_media / webview_flutter.dart '

これが最も正しい答えです。

webview_flutterとyoutube_player_flutterを使用しても同じ問題が発生しました。 @srinivasanrspによるソリューションを使用しました。 できます。

1)pubspec.yamlファイルからwebview_flutterパッケージを削除します
2) import'package:webview_media /webview_flutter.dart ';を使用します。

これは問題なく機能します。

このページは役に立ちましたか?
0 / 5 - 0 評価