Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find symbol method "setAppCacheEnabled(boolean) - Ionic capacitor application

I am working on an ionic/angular application with Capacitor. I got an email from Google, and then we had to upgrade the Android SDK version to 33 from 32. When I upgraded the compileSdkVersion I got an error when building the APK.

C:\Users\sanjeewa\Desktop\The link\link\link-client\node_modules\@capacitor\android\capacitor\src\main\java\com\getcapacitor\Bridge.java:421: error: cannot find symbol
        settings.setAppCacheEnabled(true);
                ^
  symbol:   method setAppCacheEnabled(boolean)
  location: variable settings of type WebSettings

[enter image description here][1]

As the Google docs, that method is removed. Does anyone know how to fix this? [1]: https://i.sstatic.net/J7dTx.png

like image 603
sanjeewa priyanath Avatar asked Aug 02 '26 14:08

sanjeewa priyanath


1 Answers

Hi I am late but this will help

Just make a change in Bridge.java file

Comment line

settings.setAppCacheEnabled(false);

add line

settings.setCacheMode(WebSettings.LOAD_DEFAULT);

like image 171
Deepak Dholiyan Avatar answered Aug 04 '26 06:08

Deepak Dholiyan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!