flutter_inappwebview icon indicating copy to clipboard operation
flutter_inappwebview copied to clipboard

Java:504: error: cannot find symbol

Open danodin69 opened this issue 3 years ago • 9 comments

I keep getting this error whenever i am trying to compile for android

\Documents\Flutter\.pub-cache\hosted\pub.dartlang.org\flutter_inappwebview-5.4.3+7\android\src\main\java\com\pichillilorenzo\flutter_inappwebview\in_app_webview\InAppWebView.java:504: error: cannot find symbol
      settings.setAppCacheEnabled(true);

              ^

And this results to my build failing...

danodin69 avatar Jun 27 '22 07:06 danodin69

👋 @dpoxo

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!

github-actions[bot] avatar Jun 27 '22 07:06 github-actions[bot]

Same issue. Did you find a solution?

kimonneuhoff avatar Jul 01 '22 19:07 kimonneuhoff

Same issue. Did you find a solution?

No I haven't found any yet. Nor have I tried to build the project for Android recently..

But you can try running flutter pub cache repair or flutter clean

danodin69 avatar Jul 02 '22 03:07 danodin69

I have the same issue

zegnus avatar Jul 05 '22 14:07 zegnus

/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+7/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java:280: error: cannot find symbol settings.setAppCachePath(options.appCachePath); ^ symbol: method setAppCachePath(String) location: variable settings of type WebSettings /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+7/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java:494: error: cannot find symbol settings.setAppCacheEnabled(false); ^ symbol: method setAppCacheEnabled(boolean) location: variable settings of type WebSettings /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+7/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java:504: error: cannot find symbol settings.setAppCacheEnabled(true); ^ symbol: method setAppCacheEnabled(boolean) location: variable settings of type WebSettings /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+7/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java:515: error: cannot find symbol settings.setAppCachePath(ctx.getCacheDir().getAbsolutePath()); ^ symbol: method setAppCachePath(String) location: variable settings of type WebSettings /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+7/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java:517: error: cannot find symbol settings.setAppCacheEnabled(true); ^ symbol: method setAppCacheEnabled(boolean) location: variable settings of type WebSettings /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+7/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java:521: error: cannot find symbol settings.setAppCacheEnabled(false); ^ symbol: method setAppCacheEnabled(boolean) location: variable settings of type WebSettings /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+7/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/in_app_webview/InAppWebView.java:767: error: cannot find symbol settings.setAppCachePath(newOptions.appCachePath); ^ symbol: method setAppCachePath(String) location: variable settings of type WebSettings Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 7 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':flutter_inappwebview:compileDebugJavaWithJavac'.

sunilguptasg avatar Jul 07 '22 06:07 sunilguptasg

@sunilguptasg @dpoxo Were you able to solve this problem?

moein-keyvani-pur avatar Aug 02 '22 05:08 moein-keyvani-pur

Not sure what I did, I downgraded some versions - for me 5.3.2 works.

sunilguptasg avatar Aug 02 '22 06:08 sunilguptasg

@dpoxo I downgraded to the minimum version with Null safety, but the issue remains. Please help :(

flutter_inappwebview\in_app_webview\InAppWebView.java:271: error: cannot find symbol
      settings.setAppCachePath(options.appCachePath);
              ^
  symbol:   method setAppCachePath(String)
  location: variable settings of type WebSettings

For me, this issue happens after upgrading Android compileSdkVersion from 32 to 33.

yasaman93 avatar Aug 13 '22 12:08 yasaman93

i am getting same error even i don't use this package any more please help how can i solve this issue ?

vijayvaghela72 avatar Aug 22 '22 08:08 vijayvaghela72