import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
//const URL = 'http://diariodigital.seduc.am.gov.br'; //This link is the one for our web application that I want to run
//const URL = 'http://g1.globo.com'; //This is another page I tried loading, to no avail.
const URL = 'http://flutter.io'; // This page works just fine
//const URL = 'https://google.com'; // So does this one
const TITLE = 'Webview Test';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: TITLE,
theme: new ThemeData.dark(),
routes: {
"/": (_) => WebviewScaffold(
url: URL,
withJavascript: true,
withLocalStorage: true,
appBar: AppBar(
title: Text(TITLE),
),
),
},
);
}
}
And I get the following console output for the Android version:
Initializing gradle...Resolving dependencies...Running 'gradlew assembleDebug'...Built build/app/outputs/apk/debug/app-debug.apk.Installing build/app/outputs/apk/app.apk...I/OpenGLRenderer( 4918): Davey! duration=2875ms; Flags=1, IntendedVsync=433018698412, Vsync=434118698368, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=434134124095, AnimationStart=434134162421, PerformTraversalsStart=434134166351, DrawStart=434150927957, SyncQueued=434175871692, SyncStart=434202979811, IssueDrawCommandsStart=434203148887, SwapBuffers=434933574612, FrameCompleted=435921348723, DequeueBufferDuration=89654000, QueueBufferDuration=1470000, Syncing files to device Android SDK built for x86...I/WebViewFactory( 4918): Loading com.android.chrome version 66.0.3359.158 (code 336015817)I/odigitalwebvie( 4918): The ClassLoaderContext is a special shared library.I/cr_LibraryLoader( 4918): Time to load native libraries: 14 ms (timestamps 8669-8683)I/chromium( 4918): [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0I/cr_LibraryLoader( 4918): Expected native library version number "66.0.3359.158", actual native library version number "66.0.3359.158"W/cr_ChildProcLH( 4918): Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = trueI/cr_BrowserStartup( 4918): Initializing chromium process, singleProcess=falseI/cr_base ( 4918): Android Locale: en_US requires .pak files: [en-GB.pak, en-US.pak]E/chromium( 4918): [ERROR:devtools_http_handler.cc(292)] Cannot start http server for devtools. Stop devtools.W/odigitalwebvie( 4918): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;-><init>(Landroid/content/Context;I)V (light greylist, reflection)W/odigitalwebvie( 4918): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;->logEvent(Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;)V (light greylist, reflection)W/odigitalwebvie( 4918): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionStarted(I)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)W/odigitalwebvie( 4918): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(II)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)W/odigitalwebvie( 4918): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)W/odigitalwebvie( 4918): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextSelection;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)W/odigitalwebvie( 4918): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(III)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)W/odigitalwebvie( 4918): Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(IIILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)E/MethodChannel#flutter_webview_plugin( 4918): Failed to handle method callE/MethodChannel#flutter_webview_plugin( 4918): java.lang.ClassCastException: android.webkit.WebView cannot be cast to com.flutter_webview_plugin.ObservableWebViewE/MethodChannel#flutter_webview_plugin( 4918): at com.flutter_webview_plugin.WebviewManager.<init>(WebviewManager.java:102)E/MethodChannel#flutter_webview_plugin( 4918): at com.flutter_webview_plugin.FlutterWebviewPlugin.openUrl(FlutterWebviewPlugin.java:93)E/MethodChannel#flutter_webview_plugin( 4918): at com.flutter_webview_plugin.FlutterWebviewPlugin.onMethodCall(FlutterWebviewPlugin.java:42)E/MethodChannel#flutter_webview_plugin( 4918): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)E/MethodChannel#flutter_webview_plugin( 4918): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:165)E/MethodChannel#flutter_webview_plugin( 4918): at android.os.MessageQueue.nativePollOnce(Native Method)E/MethodChannel#flutter_webview_plugin( 4918): at android.os.MessageQueue.next(MessageQueue.java:326)E/MethodChannel#flutter_webview_plugin( 4918): at android.os.Looper.loop(Looper.java:160)E/MethodChannel#flutter_webview_plugin( 4918): at android.app.ActivityThread.main(ActivityThread.java:6669)E/MethodChannel#flutter_webview_plugin( 4918): at java.lang.reflect.Method.invoke(Native Method)E/MethodChannel#flutter_webview_plugin( 4918): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)E/MethodChannel#flutter_webview_plugin( 4918): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)W/cr_CrashFileManager( 4918): /data/user/0/br.gov.am.prodam.diariodigitalwebview/cache/WebView/Crash Reports does not exist or is not a directoryD/ ( 4918): HostConnection::get() New Host Connection established 0xbf1a4e00, tid 4939D/EGL_emulation( 4918): eglMakeCurrent: 0xdd322320: ver 3 0 (tinfo 0xdc16fc20)I/Choreographer( 4918): Skipped 38 frames! The application may be doing too much work on its main thread.I/OpenGLRenderer( 4918): Davey! duration=3269ms; Flags=0, IntendedVsync=448266768117, Vsync=448300101449, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=448313904326, AnimationStart=448313942853, PerformTraversalsStart=448314555240, DrawStart=448332550193, SyncQueued=448332676168, SyncStart=448575849262, IssueDrawCommandsStart=448958294037, SwapBuffers=451049540435, FrameCompleted=451779412740, DequeueBufferDuration=68000, QueueBufferDuration=2580000, I/Choreographer( 4918): Skipped 168 frames! The application may be doing too much work on its main thread.I/OpenGLRenderer( 4918): Davey! duration=797ms; Flags=0, IntendedVsync=448321315137, Vsync=448954648445, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=448967229896, AnimationStart=448967271215, PerformTraversalsStart=448970459401, DrawStart=448977922820, SyncQueued=448978430648, SyncStart=451779722472, IssueDrawCommandsStart=451779841984, SwapBuffers=451781443276, FrameCompleted=451919659338, DequeueBufferDuration=15793000, QueueBufferDuration=1971000,
This is the iOS version of the app:
And the console output:
Starting Xcode build...Xcode build done.Syncing files to device iPhone X...
This is my yaml file:
name: diario_digital_webview
description: Aplicativo Móvel do Diario Digital
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
flutter_webview_plugin: ^0.2.1+1
shared_preferences: ^0.4.2
url_launcher: ^3.0.3
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
And the flutter doctor -v output:
lucianopinto@Lucianos-MacBook-Pro:~/AndroidStudioProjects/diario_digital_webvieww|master⚡ Can somebody with more experience help me out? What am I doing wrong? Do I need any other plugins to make it work?
Thanks in advance!!
Cheers,
Luciano Pinto
--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.