gradle build failure Execution failed for task ':webview_flutter:compileDebugJavaWithJavac'

Viewed 835

My flutter app doesn't even have webview_flutter plugin and it's showing error for that. Gradle build failure. First it told me to set minSDkVersion to 19. I did that but still error. I had the same app but different project running before with exact same code and plugins. I don't understand what's going on. Please help.

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\thumbnails- 
1.0.1\android\src\main\java\com\asapjay\thumbnails\ThumbnailsPlugin.java uses or overrides a 
deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\flutter\.pub-cache\hosted\pub.dartlang.org\webview_flutter- 
2.0.6\android\src\main\java\io\flutter\plugins\webviewflutter\InputAwareWebView.java:31: error: 
cannot find symbol
private ThreadedInputConnectionProxyAdapterView proxyAdapterView;
      ^
symbol:   class ThreadedInputConnectionProxyAdapterView
location: class InputAwareWebView
C:\flutter\.pub-cache\hosted\pub.dartlang.org\webview_flutter- 
2.0.6\android\src\main\java\io\flutter\plugins\webviewflutter\InputAwareWebView.java:112: error: 
cannot find symbol
    new ThreadedInputConnectionProxyAdapterView(
        ^
symbol:   class ThreadedInputConnectionProxyAdapterView
location: class InputAwareWebView
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':webview_flutter:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more 
log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 44s
Exception: Gradle task assembleDebug failed with exit code 1
2 Answers

ThreadedInputConnectionProxyAdapterView has wrong extension .jav You can just change it to .java by hand as a temporary fix.

or

I temporarily downgraded webview_flutter back to 2.0.4. (after downgrading webview_flutter if this solution not working then you need to check your pubsepc.lock file for webview_flutter, because some other dependencies may extend webview_flutter so this package will visible in pubsepc.lock file, then you just need downgrade webview_flutter from this file also)

Enjoy!

This happen because of the webview_flutter package version issue. I have downgrade the version and it worked. Go to the pubspec.yaml and downgrade the version to 2.0.14

Related