在外部存储中自动生成app_webview和code_cache文件夹

时间:2018-02-15 13:40:36

标签: android webview

我的项目运行正常,但它生成了一些文件夹,这使得它比apk本身占用更多空间。我理解的问题中的第一个文件夹来自我的webview,尽管设置webview不存储任何缓存,但它仍然会这样做。

然而,第二个,我不知道它的来源。我发布了我的webview代码,但对于另一个代码,请告诉我它可能来自哪里。我还会发布我的build.gradle,以防它是一个图书馆。

这是我的webview

web.loadUrl(selectedProduct.url);
    web.setWebViewClient(new myWebClient());
    web.getSettings().setJavaScriptEnabled(true);
    web.getSettings().setLoadWithOverviewMode(true);
    web.getSettings().setUseWideViewPort(true);
    web.getSettings().setBuiltInZoomControls(false);
    web.getSettings().setSupportZoom(true);
    web.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    web.getSettings().setAllowFileAccess(true);
    web.getSettings().setDomStorageEnabled(true);
    web.getSettings().setPluginState(WebSettings.PluginState.ON);
    web.getSettings().setAppCacheEnabled(false);
    web.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
    web.clearCache(true);

这是我的gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.kamble.e_nunua"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    multiDexEnabled true
    versionName "A"
      testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/ASL2.0'
}

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
allprojects {
    repositories {
        jcenter()
        flatDir {
            dirs 'libs'
        }
        maven {
            url "https://jitpack.io"
        }
    }
}
repositories {
    mavenCentral()
    google()
}}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.toe.chowder:chowder:0.7.6'
implementation 'com.github.siyamed:android-shape-imageview:0.9.3@aar'
implementation 'com.github.amlcurran.showcaseview:library:5.4.3'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
implementation 'com.intuit.ssp:ssp-android:1.0.5'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'}

0 个答案:

没有答案