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

App Crashes after clicking on dropdown (Using inappwebview) #182

Closed
eco4ndly opened this issue Nov 1, 2019 · 38 comments
Closed

App Crashes after clicking on dropdown (Using inappwebview) #182

eco4ndly opened this issue Nov 1, 2019 · 38 comments

Comments

@eco4ndly
Copy link

eco4ndly commented Nov 1, 2019

Environment

Android version: Android 6.0
Device information: Emulator (Pixel 3a XL API 23)

Description

Expected behavior:
Should open the dropdown

Current behavior:
App Crashes

Steps to reproduce

  1. Open any HTML dropdown

Stacktrace/Logcat

--------- beginning of crash
11-01 22:35:30.694 2978-2978/com.vuka.vuka_app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.vuka.vuka_app, PID: 2978
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1351)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2774)
at android.content.res.Resources.getLayout(Resources.java:1165)
at android.view.LayoutInflater.inflate(LayoutInflater.java:421)
at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:378)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:369)
at org.chromium.content.browser.input.SelectPopupAdapter.getView(SelectPopupAdapter.java:56)
at android.widget.AbsListView.obtainView(AbsListView.java:2346)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1280)
at android.widget.ListView.onMeasure(ListView.java:1188)
at android.view.View.measure(View.java:18788)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18788)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18788)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:748)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:630)
at android.view.View.measure(View.java:18788)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18788)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:18788)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643)
at android.view.View.measure(View.java:18788)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1191)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Flutter doctor log

[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.15 19A603, locale en-GB)
• Flutter version 1.9.1+hotfix.2 at /Users/sayanporya/Flutter/flutter
• Framework revision 2d2a1ffec9 (8 weeks ago), 2019-09-06 18:39:49 -0700
• Engine revision b863200c37
• Dart version 2.5.0

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/sayanporya/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 28.0.3
• ANDROID_HOME = /Users/sayanporya/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[!] Xcode - develop for iOS and macOS (Xcode 10.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.3, Build version 10G8
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
pod setup

[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 39.0.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Community Edition (version 2019.1.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 38.2.2
• Dart plugin version 191.8369

[✓] VS Code (version 1.38.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.4.1

[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 6.0 (API 23) (emulator)

@pichillilorenzo
Copy link
Owner

You can try the latest version of the plugin! Also, this plugin changed its name to flutter_inappwebview. The current latest version now is 2.1.0+1. So, you can change your dependency influtter_inappwebview: ^2.1.0+1.

@Poplipo
Copy link

Poplipo commented Dec 9, 2019

I tried it with the latest version & correct name - same issue, but different stacktrace:
(Tested on Moto G5 Plus, Android 8.1.0)

W/System.err( 8780): java.lang.ClassCastException: $Proxy1 cannot be cast to android.view.WindowManagerImpl
W/System.err( 8780): 	at android.view.Window.setWindowManager(Window.java:771)
W/System.err( 8780): 	at android.view.Window.setWindowManager(Window.java:752)
W/System.err( 8780): 	at android.app.Dialog.<init>(Dialog.java:194)
W/System.err( 8780): 	at android.app.AlertDialog.<init>(AlertDialog.java:201)
W/System.err( 8780): 	at android.app.AlertDialog$Builder.create(AlertDialog.java:1088)
W/System.err( 8780): 	at TH2.a(PG:3)
W/System.err( 8780): 	at Yp2.<init>(PG:5)
W/System.err( 8780): 	at org.chromium.content.browser.input.SelectPopup.show(PG:12)
W/System.err( 8780): 	at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err( 8780): 	at android.os.MessageQueue.next(MessageQueue.java:325)
W/System.err( 8780): 	at android.os.Looper.loop(Looper.java:142)
W/System.err( 8780): 	at android.app.ActivityThread.main(ActivityThread.java:6626)
W/System.err( 8780): 	at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 8780): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
W/System.err( 8780): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
F/chromium( 8780): [FATAL:jni_android.cc(249)] Please include Java exception stack in crash report
F/libc    ( 8780): Fatal signal 5 (SIGTRAP), code 4 in tid 8780 (REDACTED), pid 8780 (REDACTED)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'motorola/potter_n/potter_n:8.1.0/OPS28.85-17-6-2/77e7:user/release-keys'
Revision: 'p3b0'
ABI: 'arm'
pid: 8780, tid: 8780, name: REDACTED  >>> REDACTED <<<
signal 5 (SIGTRAP), code 4 (TRAP_HWBKPT), fault addr 0xa0078a8a
    r0 00000000  r1 00000000  r2 7fffffff  r3 00000000
    r4 0000004f  r5 be9bed1c  r6 a17fce48  r7 a17c8438
    r8 be9be8c4  r9 be9bed14  sl be9bed18  fp be9be8c4
    ip be9be878  sp be9be8b0  lr b568fee1  pc a0078a8a  cpsr 60070030
backtrace:

This seems to be a known issue with other webview implementations (see also: flutter/flutter#25767) - do you think a fix or workaround for this library is possible?

@pichillilorenzo
Copy link
Owner

@Poplipo Thanks for the link! Maybe, a possible workaround could be done using javascript handlers to communicate with the web page:

  • detect when the user clicks on a <select> tag
  • call event.preventDefault() for that event and then call window.flutter_inappwebview.callHandler('myHandler', here the list of all options of the select) where, for example, the list of the options could be an object key:value, where key is the value attribute of the option tag and the object value is the name for that option
  • on flutter side, when you receive the call from the javascript side, you can display a custom select popup
  • then, when the flutter side returns the selected option by the user, you can dispatch a javascript event for that <select> tag as it was selected natively.

However, I need to check it more as soon as possible, because I'm fixing also other issues!

@pichillilorenzo pichillilorenzo changed the title App Crashes after clicking on dropdown (Using inappbrowser) App Crashes after clicking on dropdown (Using inappwebview) Dec 10, 2019
@pichillilorenzo
Copy link
Owner

@Poplipo Ok, I found a possible fix for that using JavaScript, so javascript must be enabled, otherwise it won't work. I will post it as soon as possible!

pichillilorenzo added a commit that referenced this issue Dec 11, 2019
…temporary workaround for html dropdowns (issue #182)
@pichillilorenzo
Copy link
Owner

pichillilorenzo commented Dec 11, 2019

@Poplipo I have added the new dropDownWorkaroundEnabled webview option for Android to enable a temporary workaround for html dropdowns! Also, JavaScript must be enabled to make it work.

To test my latest commit with the workaround, you can point the dependency on the master branch of this repository (see https://flutter.dev/docs/development/packages-and-plugins/using-packages#dependencies-on-unpublished-packages).

You need to enable it like this:

...

child: InAppWebView(
  initialUrl: "https://myUrl.com",
  initialHeaders: {},
  initialOptions: InAppWebViewWidgetOptions(
      inAppWebViewOptions: InAppWebViewOptions(
        debuggingEnabled: true,
      ),
      androidInAppWebViewOptions: AndroidInAppWebViewOptions(
        dropDownWorkaroudEnabled: true
      )
  ),
  onWebViewCreated: (InAppWebViewController controller) {
    webView = controller;
  },

...

Let me know if now the dropdowns work! Thanks!

@vshashi01
Copy link

vshashi01 commented Dec 11, 2019

@pichillilorenzo Thanks for the update, just tried on the emulator and still crashes for me.

This is how I used it. Do I still need to do something to make it work? I will try on an actual device as soon as I get free,

Thank you.

child: InAppWebView(
                    onWebViewCreated: (controller) {
                      _webController = controller;
                    },
                    initialUrl: initialUrl,
                    initialOptions: InAppWebViewWidgetOptions(
                      inAppWebViewOptions: InAppWebViewOptions(
                        javaScriptEnabled: true,
                        javaScriptCanOpenWindowsAutomatically: true,
                        debuggingEnabled: true,
                      ),
                      androidInAppWebViewOptions: AndroidInAppWebViewOptions(
                        dropDownWorkaroundEnabled: true,
                      ),
                    ),
                    onLoadStop: (controller, url) async {
                      if (url == initialUrl) {
                        isLoggedInStreamController.add(false);
                        if (state is LeavePlannerAuthModelReady &&
                            !autoLoginAttemptedOnce) {
                          await _doAutoLogin(
                              state.authModel.userID, state.authModel.password);
                          autoLoginAttemptedOnce = true;
                        }
                      } 
                    },
                    onProgressChanged: (controller, progress) {
                      setState(() {
                        pageLoadProgress = progress / 100;
                      });
                    },
                  ),
                ),

@pichillilorenzo
Copy link
Owner

@vshashi01 can you share the URL that gives you the problem? Also, I need to test another workaround that could be better then this one! I will update it as soon as possible

@Poplipo
Copy link

Poplipo commented Dec 11, 2019

Thanks for the workaround! I tried it, but it looks like it doesn't trigger the change event on the select-tag when you select an option in the native dialog.

We meanwhile looked at an alternative workaround too, based on comments in the issue linked earlier - we change the constructor and pass an ActivityContext to the webview instead of the application context. (view reply below for formatted code)

This seems to work well on smartphone in our case, but we are running into some issues on tablet, since dropdowns are handled differently on tablet (they don't create a native dialog it seems). We are looking into this and will update as well!

@Poplipo
Copy link

Poplipo commented Dec 11, 2019

   import io.flutter.app.FlutterApplication;

    Context activityContext = context;
    Context appContext = context.getApplicationContext();
    if (appContext instanceof FlutterApplication) {
      Activity currentActivity = ((FlutterApplication) appContext).getCurrentActivity();
      if (currentActivity != null) {
        activityContext = currentActivity;
      }
    }
    webView = new InAppWebView(registrar, activityContext, this, id, options, containerView);

@Poplipo
Copy link

Poplipo commented Dec 11, 2019

Update:

With the above activityContext fix, we have working dropdowns on Android smartphones. This is without using dropdownWorkaroundEnabled. However, using the same fix on Android tablets, the dropdowns don't even open - you can see they get focussed, but you don't get to see the options.

If we use the dropdownWorkAroundEnabled, it works on Android smartphones, but doesn't seem to trigger the change event of the dropdown. On Android tablets again, the dropdown gets focussed but the native dialog is not triggered.

If we use the latest tag v2.1.0+1, it crashes on Android smartphones. This time, Android tablets opens the dropdown without a native dialog. When actually selecting an item from the list, it doesn't work: it just removes the focus from the dropdown without actually selecting the new item.

Just to make sure, I tried a native android app with a standard webkit webview - in this case, dropdowns are handled correctly on both smartphone and tablet.

Hope this helps!

@pichillilorenzo
Copy link
Owner

@Poplipo Using the activityContext fix, as said already on the flutter official issue flutter/flutter#25767, isn't a good solution because it will break keyboard for input text elements (maybe keyboard will work on the first webview, but on multiple webviews will break it), so it can't be used as a general solution.

I need to try another workaround (using JavaScript) I have in mind that should work for both Android phones and tablets. It could break some css styles coming from external resources (not inline css styles) for <select> tag elements but it depends on how css is written.

I will let you know as soon as possible.

@pichillilorenzo
Copy link
Owner

@Poplipo @vshashi01 I have updated the repository! Try with the latest commit. Now it should work and call also the change event for JavaScript

@vshashi01
Copy link

@pichillilorenzo It now works on an actual device on the first launch.

The current problem seems to be after the first click, reclicking on the dropdown again, crashes the app instead.

This is still better than previously I think but if it could be fixed, that should be good.

Also, it still crashes on emulator, but that could be a weird emulator problem.

@pichillilorenzo
Copy link
Owner

@vshashi01 can you post some html (with css and javascript) code or url you are sure is not working with, please?? Otherwise I can't test and fix it. I tested on a very simple html containing two select tags, which one has the multiple attribute enabled to allow multiple values, and it is working every time I click on it. So, I don't know why is not working for you

@Delaney
Copy link

Delaney commented Dec 12, 2019

As stated here flutter/flutter#25767 (comment), a temporary workaround would be using an external Javascript lib such as Select2.
That's if you have access to the Webview HTML code.

@pichillilorenzo
Copy link
Owner

@DieBrise yeah, I have seen that, but my workaround tries to mimic the same behavior as android webview would do, wrapping the original select tag in a span tag wrapper in order to mantain the style applied to it as the website owner has created without using an external JavaScript library, and communicating with Java code to show the AlertDialog.

@pichillilorenzo
Copy link
Owner

This is a working example:
ezgif com-video-to-gif

The full code for this example:

import 'dart:async';

import 'package:flutter/material.dart';

import 'package:flutter_inappwebview/flutter_inappwebview.dart';

Future main() async {
  runApp(new MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: InAppWebViewPage()
    );
  }
}

class InAppWebViewPage extends StatefulWidget {

  @override
  _InAppWebViewPageState createState() => new _InAppWebViewPageState();
}

class _InAppWebViewPageState extends State<InAppWebViewPage> with WidgetsBindingObserver {
  InAppWebViewController webView;

  @override
  Widget build(BuildContext context) {

    return Scaffold(
        appBar: AppBar(
            title: Text("InAppWebView")
        ),
        body: SafeArea(
            child: Column(children: <Widget>[
              Expanded(
                child: Container(
                  child: InAppWebView(
                    initialData: InAppWebViewInitialData(
                      data: """
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Flutter InAppWebView</title>
</head>
<body>
    <select style="height: 30px;">
      <option value="option-1">Option 1</option>
      <option value="option-2">Option 2</option>
      <option value="option-3">Option 3</option>
      <option value="option-4">Option 4</option>
    </select>
    
    <br>
    <br>
    
    <select multiple="multiple" style="height: 30px; min-width: 250px;">
      <option value="option-1">Option 1</option>
      <option value="option-2">Option 2</option>
      <option value="option-3">Option 3</option>
      <option value="option-4">Option 4</option>
    </select>
</body>
</html>
                      """
                    ),
                    initialHeaders: {},
                    initialOptions: InAppWebViewWidgetOptions(
                        inAppWebViewOptions: InAppWebViewOptions(
                          debuggingEnabled: true,
                        ),
                        androidInAppWebViewOptions: AndroidInAppWebViewOptions(
                          dropDownWorkaroundEnabled: true
                        )
                    ),
                    onWebViewCreated: (InAppWebViewController controller) {
                      webView = controller;
                    },
                    onLoadStart: (InAppWebViewController controller, String url) {

                    },
                    onLoadStop: (InAppWebViewController controller, String url) {

                    },
                  ),
                )
              ),
            ]))
    );
  }
}

@Delaney
Copy link

Delaney commented Dec 12, 2019

@pichillilorenzo Using your example above with the InitialData works fine. However, I took out the select2 lib from my webpage and tried it again, the app still crashes. Both on my real phone and Android emulator.

I thought it may have to do with something on my webpage, so I changed the URL to W3School's Select page. Same result.

@pichillilorenzo
Copy link
Owner

@DieBrise can you post the URL of your webpage, so I can debug my workaround?
W3School's Select page loads the select element in an iframe, so my javascript code can't reach it now. I will try to add this case to my workaround.

@pichillilorenzo
Copy link
Owner

pichillilorenzo commented Dec 12, 2019

@DieBrise @Poplipo @vshashi01 Updated with the latest commit! Try the latest commit! Now it should work also on <iframe> with the same origin (JavaScript can't access on iframes of different origin for security reasons).

Also, this workaround is applied as soon as the web page fires the DOMContentLoaded JavaScript event (that should be pretty quickly!). From MDN:

The DOMContentLoaded event fires when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.

So, if a user clicks on a select element before this event, then it will crash because the workaround needs to wait for this JavaScript event, otherwise, it won't work.

Full code example using the W3School's Select page:

import 'dart:async';

import 'package:flutter/material.dart';

import 'package:flutter_inappwebview/flutter_inappwebview.dart';

Future main() async {
  runApp(new MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: InAppWebViewPage()
    );
  }
}

class InAppWebViewPage extends StatefulWidget {

  @override
  _InAppWebViewPageState createState() => new _InAppWebViewPageState();
}

class _InAppWebViewPageState extends State<InAppWebViewPage> with WidgetsBindingObserver {
  InAppWebViewController webView;

  @override
  Widget build(BuildContext context) {

    return Scaffold(
        appBar: AppBar(
            title: Text("InAppWebView")
        ),
        body: SafeArea(
            child: Column(children: <Widget>[
              Expanded(
                  child: Container(
                    child: InAppWebView(
                      initialUrl: "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select",
                      initialHeaders: {},
                      initialOptions: InAppWebViewWidgetOptions(
                          inAppWebViewOptions: InAppWebViewOptions(
                            debuggingEnabled: true,
                          ),
                          androidInAppWebViewOptions: AndroidInAppWebViewOptions(
                              dropDownWorkaroundEnabled: true
                          )
                      ),
                      onWebViewCreated: (InAppWebViewController controller) {
                        webView = controller;
                      },
                      onLoadStart: (InAppWebViewController controller, String url) {

                      },
                      onLoadStop: (InAppWebViewController controller, String url) {

                      },
                    ),
                  )
              ),
            ]))
    );
  }
}

Result:

ezgif com-video-to-gif (1)

@Delaney
Copy link

Delaney commented Dec 12, 2019

@pichillilorenzo It's a private URL, is there any way I can send it to you?

@vshashi01
Copy link

@pichillilorenzo I just tried your latest update, on the website I am trying to use it on, it works fine to click it twice now. However, if I focused on a text input and then focused back to the dropdown menu, then it crashed again.

Since its a confidential site, I thought i would make an example with w3S school to simulate the issue, but on my device even then basic select tag through w3S crashes as shown in the gif below.

Could this be a device issue?

ezgif com-resize

@davedega
Copy link

I have the same issue, app crashes when i tap on the dropdown

You can try with this html

https://davedega.github.io/vera/index.html

@pichillilorenzo
Copy link
Owner

@davedega @Poplipo @DieBrise @vshashi01 I have finally found a fix that works without using any javascript code! Now it should always work. Please try my latest commit and let me know! Thanks to everyone

@davedega
Copy link

@pichillilorenzo great job!
Looking forward to have a release with this improvement 👍 🎉

@Poplipo
Copy link

Poplipo commented Dec 16, 2019

@pichillilorenzo thanks so much for your hard work on this! Because of deadlines, we ended up implementing a native activity, but we'll keep this lib in mind for our next project :)

@vshashi01
Copy link

@pichillilorenzo it works just as expected. Will you be making an official release with the current changes, or should I continue to depend on the git repo?

@pichillilorenzo
Copy link
Owner

@vshashi01 yes, I'm going to release a new major release (3.0.0) as soon as possibile with a lot of fixes, new methods, events and options! I think I can publish it today or tomorrow

@ridz0n3
Copy link

ridz0n3 commented Dec 20, 2019

hi,
i cannot find this function....
androidInAppWebViewOptions: AndroidInAppWebViewOptions( dropDownWorkaroundEnabled: true )

@pichillilorenzo
Copy link
Owner

@ridz0n3 because that option has been deleted. If you are using the master branch of this plugin, then it shuold work without any option, instead, if you are using the latest published version 2.1.0+1, then this fix isn't there. You need to wait for the official release (version 3.0.0).

@vshashi01
Copy link

@pichillilorenzo I can still reproduce this crash with Flutter 1.12 release and the master branch of this repo. I can reproduce this crash both in the emulator and on a Samsung device.

@sunydepalpur
Copy link

@ridz0n3 because that option has been deleted. If you are using the master branch of this plugin, then it shuold work without any option, instead, if you are using the latest published version 2.1.0+1, then this fix isn't there. You need to wait for the official release (version 3.0.0).

Hi when you are releasing the new version

@ShanmugavelGK
Copy link

hi,
i cannot find this function....
androidInAppWebViewOptions: AndroidInAppWebViewOptions( dropDownWorkaroundEnabled: true )

  1. Still now can't find.
  2. Still dropdown not working in android tablet
    Any solution.

@arnaudelub
Copy link

@ShanmugavelGK it's not maintained anymore apparently, we are maintaining a fork of this package flutter_polywebview, feel free to try it, just change the package name, all the rest remain the same

@ShanmugavelGK
Copy link

@arnaudelub Thanks for updating bro.

@luisphp89
Copy link

Environment

Android version: Android 6.0 Device information: Emulator (Pixel 3a XL API 23)

Description

Expected behavior: Should open the dropdown

Current behavior: App Crashes

Steps to reproduce

  1. Open any HTML dropdown

Stacktrace/Logcat

--------- beginning of crash 11-01 22:35:30.694 2978-2978/com.vuka.vuka_app E/AndroidRuntime: FATAL EXCEPTION: main Process: com.vuka.vuka_app, PID: 2978 android.content.res.Resources$NotFoundException: Resource ID #0x0 at android.content.res.Resources.getValue(Resources.java:1351) at android.content.res.Resources.loadXmlResourceParser(Resources.java:2774) at android.content.res.Resources.getLayout(Resources.java:1165) at android.view.LayoutInflater.inflate(LayoutInflater.java:421) at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:378) at android.widget.ArrayAdapter.getView(ArrayAdapter.java:369) at org.chromium.content.browser.input.SelectPopupAdapter.getView(SelectPopupAdapter.java:56) at android.widget.AbsListView.obtainView(AbsListView.java:2346) at android.widget.ListView.measureHeightOfChildren(ListView.java:1280) at android.widget.ListView.onMeasure(ListView.java:1188) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18788) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643) at android.view.View.measure(View.java:18788) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1191) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1452) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:606) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Flutter doctor log

[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.15 19A603, locale en-GB) • Flutter version 1.9.1+hotfix.2 at /Users/sayanporya/Flutter/flutter • Framework revision 2d2a1ffec9 (8 weeks ago), 2019-09-06 18:39:49 -0700 • Engine revision b863200c37 • Dart version 2.5.0

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3) • Android SDK at /Users/sayanporya/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 28.0.3 • ANDROID_HOME = /Users/sayanporya/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[!] Xcode - develop for iOS and macOS (Xcode 10.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 10.3, Build version 10G8 ✗ CocoaPods not installed. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install: sudo gem install cocoapods pod setup

[✓] Android Studio (version 3.5) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 39.0.3 • Dart plugin version 191.8423 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Community Edition (version 2019.1.1) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 38.2.2 • Dart plugin version 191.8369

[✓] VS Code (version 1.38.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.4.1

[✓] Connected device (1 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 6.0 (API 23) (emulator)

This error happened again in flutter 3.3.4, I'm using android 5.1 on a physical device (Moto G). The Error in Stacktrace/Logcat is exactly that. When I was using Flutter version 2.10.5 this error did not happen.

@AbdulWahabKhanDanat
Copy link

Is there any workaround? still facing this issue in flutter_inappwebview : 5.8.0 and 6.0

@pichillilorenzo
Copy link
Owner

@AbdulWahabKhanDanat create a new issue with all the related info, such as Android version, flutter version, code example with reproducible steps, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests