ponnamkarthik / FlutterWebView

Flutter Plugin that Renders Native Webview as a widget in flutter
Other
62 stars 26 forks source link

Error while compiling #2

Closed Diaglyonok closed 5 years ago

Diaglyonok commented 5 years ago

image and as text: ( C:\Work\flutter.pub-cache\hosted\pub.dartlang.org\flutter_native_web-0.1.2\android\src\main\java\io\github\ponnamkarthik\flutterwebview\FlutterwebviewFactory.java:10: error: no interface expected here public class FlutterwebviewFactory extends PlatformViewFactory { ^ C:\Work\flutter.pub-cache\hosted\pub.dartlang.org\flutter_native_web-0.1.2\android\src\main\java\io\github\ponnamkarthik\flutterwebview\FlutterwebviewFactory.java:19: error: method does not override or implement a method from a supertype @Override ^ C:\Work\flutter.pub-cache\hosted\pub.dartlang.org\flutter_native_web-0.1.2\android\src\main\java\io\github\ponnamkarthik\flutterwebview\FlutterwebviewPlugin.java:11: error: incompatible types: FlutterwebviewFactory cannot be converted to PlatformViewFactory "ponnamkarthik/flutterwebview", new FlutterwebviewFactory(registrar)); ^ Note: C:\Work\flutter.pub-cache\hosted\pub.dartlang.org\flutter_native_web-0.1.2\android\src\main\java\io\github\ponnamkarthik\flutterwebview\FlutterWeb.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 3 errors

FAILURE: Build failed with an exception.

BUILD FAILED in 7s Finished with error: Gradle build failed: 1 )

Getting this when install this lib.

Is there any solutions?

Diaglyonok commented 5 years ago

Flutter doctor:

image

Diaglyonok commented 5 years ago

Changing code of FLutterWebViewFactory in android/src/main/java/io/github/ponnamkarthik/flutterwebview/FlutterwebviewFactory.java to

`public class FlutterwebviewFactory implements PlatformViewFactory {

private final Registrar mPluginRegistrar;

public FlutterwebviewFactory(Registrar registrar) {
    super();
    mPluginRegistrar = registrar;
}

@Override
public PlatformView create(Context context, int i) {
    return new FlutterWeb(context, mPluginRegistrar, i);
}

}`

solved the problem

ponnamkarthik commented 5 years ago

fixed 1.0.2

rajendrachauhan commented 5 years ago

github/ponnamkarthik/flutterwebview/FlutterwebviewFactory.java:15: error: constructor PlatformViewFactory in class PlatformViewFactory cannot be applied to given types; super(); ^ required: MessageCodec found: no arguments reason: actual and formal argument lists differ in length Note: /media/shreejiweb/ssdsoftware/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_web-1.0.2/android/src/main/java/io/github/ponnamkarthik/flutterwebview/FlutterWeb.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error

Is there any solution ?

Muchene commented 5 years ago

I think the original code was correct, and the patch may have caused some problems Changing that line back to super(StandardMessageCodec.INSTANCE);

fixed my compilation issue.

Thanks so much for the package!!

maddesa commented 5 years ago

I see the same thing as @Muchene Making the change has fixed the issue.