GithubHelp home page GithubHelp logo

sowlutions / react-native-clear-cache Goto Github PK

View Code? Open in Web Editor NEW
30.0 30.0 28.0 10 KB

React Native - Clear app cache

Java 62.01% JavaScript 0.96% Objective-C 29.85% Ruby 7.18%
clear-cache react-native

react-native-clear-cache's People

Contributors

rockhalil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-native-clear-cache's Issues

dont works in ios

i try to delete the cache of my app in ios but no works, the size look same

any suggestion?

cache iphone

TypeError: Cannot read property 'getAppCacheSize' of undefined

Unhandled JS Exception: TypeError: Cannot read property 'getAppCacheSize' of undefined

This error is located at:
in NavigationContainer (at Router.js:101)
in App (at Router.js:127)
in Router (at Router.js:59)
in RouterComponent (created by ConnectFunction)
in ConnectFunction (at App.js:17)
in PersistGate (at App.js:16)
in RNCAppearanceProvider (at src/index.tsx:70)
in AppearanceProvider (at App.js:15)
in Provider (at App.js:14)
in App (at renderApplication.js:45)
in RCTView (at AppContainer.js:109)
in RCTView (at AppContainer.js:135)
in AppContainer (at renderApplication.js:39)

Gralde7.x兼容性匹配,替换build.gralde文件内容即可,可以使用的点个赞

复制一下全部内容即可

// android/build.gradle

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

buildscript {
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
if (project == rootProject) {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
}
}
}

apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

// Matches values in recent template from React Native 0.59 / 0.60
// https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L5-L9
// https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle#L5-L9
def DEFAULT_COMPILE_SDK_VERSION = 31
def DEFAULT_BUILD_TOOLS_VERSION = "31.0.0"
def DEFAULT_MIN_SDK_VERSION = 21
def DEFAULT_TARGET_SDK_VERSION = 31

android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
}

repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
// Android JSC is installed from npm
url "$rootDir/../node_modules/jsc-android/dist"
}
google()
jcenter()
}

dependencies {
// ref:
// https://github.com/facebook/react-native/blob/0.61-stable/template/android/app/build.gradle#L192
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
}

afterEvaluate {
//发布的 jar 包配置
publishing{
publications{
release(MavenPublication) {
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)

            groupId = "com.reactlibrary.clearcache"
            artifactId = packageJson.name
            version = packageJson.version
            //aar 文件
            def projectName = project.getName()
            artifact "build/outputs/aar/${projectName}-release.aar"

            pom.withXml{
                def dependenciesNode = asNode().appendNode("dependencies")
                configurations.implementation.allDependencies.forEach(){
                    Dependency dependency ->
                        if (dependency.version != "unspecified" && dependency.name != "unspecified"){
                            def dependencyNode = dependenciesNode.appendNode('dependency')
                            dependencyNode.appendNode('groupId', dependency.group)
                            dependencyNode.appendNode('artifactId', dependency.name)
                            dependencyNode.appendNode('version', dependency.version)
                        }
                }
            }
        }
    }   
}

}

/Users/GinaYang/Desktop/lz_works/youbao-internet-clinic-app-rn/node_modules/react-native-clear-cache/android/src/main/java/com/reactlibrary/ClearCacheModule.java:13: 错误: 程序包android.support.annotation不存在 import android.support.annotation.Nullable;

/Users/GinaYang/Desktop/lz_works/youbao-internet-clinic-app-rn/node_modules/react-native-clear-cache/android/src/main/java/com/reactlibrary/ClearCacheModule.java:13: 错误: 程序包android.support.annotation不存在
import android.support.annotation.Nullable;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.