Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlatformException when run release build only #813

Open
4 tasks done
CarloDotLog opened this issue Apr 19, 2021 · 2 comments
Open
4 tasks done

PlatformException when run release build only #813

CarloDotLog opened this issue Apr 19, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@CarloDotLog
Copy link

Environment

Technology Version
Flutter version 2.0.5
Plugin version ^5.3.2
Android version Android 11 (API 30)
iOS version
Xcode version

Device information:
Tested with different physical devices.

Description

I have a PlatformException when run the app with --release mode. In debug or profile mode there are no problems.

Expected behavior:
Run as in debug and profile mode.

Current behavior:
Black screen with exception in console.

Steps to reproduce

  1. Create a "InAppWebView" widget that points to any url.
  2. flutter run --release
  3. PlatformException

Images

device-2021-04-19-182711

Stacktrace/Logcat

E/flutter (31616): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: com.pichillilorenzo/flutter_inappwebview
E/flutter (31616): at io.flutter.plugin.platform.j$a.d(Unknown Source:229)
E/flutter (31616): at io.flutter.embedding.engine.i.j$a.b(Unknown Source:152)
E/flutter (31616): at io.flutter.embedding.engine.i.j$a.onMethodCall(Unknown Source:144)
E/flutter (31616): at f.a.d.a.j$a.a(Unknown Source:17)
E/flutter (31616): at io.flutter.embedding.engine.e.b.e(Unknown Source:57)
E/flutter (31616): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(Unknown Source:4)
E/flutter (31616): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter (31616): at android.os.MessageQueue.next(MessageQueue.java:335)
E/flutter (31616): at android.os.Looper.loop(Looper.java:206)
E/flutter (31616): at android.app.ActivityThread.main(ActivityThread.java:8506)
E/flutter (31616): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (31616): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
E/flutter (31616): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1139)
E/flutter (31616): , null, null)
E/flutter (31616): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581)
E/flutter (31616): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158)
E/flutter (31616):
E/flutter (31616): #2 TextureAndroidViewController._sendCreateMessage (package:flutter/src/services/platform_views.dart:1036)
E/flutter (31616):
E/flutter (31616): #3 AndroidViewController.create (package:flutter/src/services/platform_views.dart:742)
E/flutter (31616):
E/flutter (31616): #4 RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:195)
E/flutter (31616):
E/flutter (31616):

@CarloDotLog CarloDotLog added the bug Something isn't working label Apr 19, 2021
@github-actions
Copy link

👋 @CarloDotLog

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

@CarloDotLog
Copy link
Author

Ciao Lorenzo,
I found a conflict with the flutter_barcode_scanner package.
With the new version flutter_barcode_scanner:2.0.0 the PlatformException is not triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant