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

dialog from html throwing me error android #381

Closed
utpalruparel opened this issue Jun 6, 2020 · 2 comments
Closed

dialog from html throwing me error android #381

utpalruparel opened this issue Jun 6, 2020 · 2 comments

Comments

@utpalruparel
Copy link

I am using flutter_inappwebview in my app and its example is running properly but when i integrate with my app I am getting below error.

2020-06-06 12:01:02.678 24736-24736/com.myapp.example W/System.err: java.lang.ClassCastException: $Proxy3 cannot be cast to android.view.WindowManagerImpl
2020-06-06 12:01:02.681 24736-24736/com.myapp.example W/System.err: at android.view.Window.setWindowManager(Window.java:770)
2020-06-06 12:01:02.681 24736-24736/com.myapp.example W/System.err: at android.view.Window.setWindowManager(Window.java:751)
2020-06-06 12:01:02.681 24736-24736/com.myapp.example W/System.err: at android.app.Dialog.(Dialog.java:339)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at android.app.AlertDialog.(AlertDialog.java:202)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at android.app.AlertDialog$Builder.create(AlertDialog.java:1106)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at Fb3.a(chromium-Monochrome.aab-stable-410409673:1)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at ST2.(chromium-Monochrome.aab-stable-410409673:5)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at org.chromium.content.browser.input.SelectPopup.show(chromium-Monochrome.aab-stable-410409673:12)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at android.os.MessageQueue.nativePollOnce(Native Method)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at android.os.MessageQueue.next(MessageQueue.java:386)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at android.os.Looper.loop(Looper.java:175)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7625)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
2020-06-06 12:01:02.682 24736-24736/com.myapp.example W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
I am using kotlin

class Application : FlutterApplication(), PluginRegistrantCallback {

override fun onCreate() {
    super.onCreate()
    FlutterFirebaseMessagingService.setPluginRegistrant(this)

}

override fun registerWith(registry: PluginRegistry) {

    GeneratedPluginRegistrant.registerWith(registry)

}

}
MainActivity

import io.flutter.plugins.GeneratedPluginRegistrant
import android.view.WindowManager.LayoutParams
import io.flutter.app.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
//getWindow().addFlags(LayoutParams.FLAG_SECURE)
}
}

@pichillilorenzo
Copy link
Owner

pichillilorenzo commented Jun 6, 2020

Could you explain in more detail when this happens? For example, when you click on a dropdown menu??

Also, Post here the flutter version, Android version, android device info, and plugin version.
If you can, post here also some code (or the URL) that is causing this error, so I can test it.

Furthermore, it seems you are not using the new Flutter Java Embedding API.
Take a look at the "IMPORTANT Note for Android" Section.
To upgrade a Flutter Application pre 1.12, check the official guide: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

This was referenced Jul 6, 2020
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants