sowlutions / react-native-clear-cache Goto Github PK
View Code? Open in Web Editor NEWReact Native - Clear app cache
React Native - Clear app cache
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)
Right now with npm, I got the requirement
peer react@"^16.8.1"
复制一下全部内容即可
// 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;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.