Android React Native-TypeError:无法读取属性';清洁';未定义的
反应本机V0.62.2。Android React Native-TypeError:无法读取属性';清洁';未定义的,android,react-native,Android,React Native,反应本机V0.62.2。 npm运行android给了我以下错误: TypeError:无法读取未定义的属性“clean” ExceptionManager.js:76不变冲突:模块AppRegistry不是已注册的可调用模块(调用runApplication) package.json android/bundle.gradle android/app/bundle.gradle 正如@AkilaDevinda建议的,我在代码中查找clean,发现我正在使用库中的cleanExtracted
npm运行android
给了我以下错误:
TypeError:无法读取未定义的属性“clean”
ExceptionManager.js:76不变冲突:模块AppRegistry不是已注册的可调用模块(调用runApplication)
package.json
android/bundle.gradle
android/app/bundle.gradle
正如@AkilaDevinda建议的,我在代码中查找
clean
,发现我正在使用库中的cleanExtractedImagesCache()
函数
react原生图像过滤器套件
问题是我在react native.config.js中禁用了android的自动链接
module.exports = {
dependencies: {
'react-native-image-filter-kit': {
platforms: {
android: null, // disable Android platform, other platforms will still autolink if provided
},
},
}
因此,在android中找不到cleanExtractedImagesCache(),并导致未定义的错误。谢谢。正如@AkilaDevinda建议的那样,我在代码中查找了
clean
,发现我正在使用库中的cleanExtractedImagesCache()
函数
react原生图像过滤器套件
问题是我在react native.config.js中禁用了android的自动链接
module.exports = {
dependencies: {
'react-native-image-filter-kit': {
platforms: {
android: null, // disable Android platform, other platforms will still autolink if provided
},
},
}
因此,在android中找不到cleanExtractedImagesCache(),并导致未定义的错误。谢谢。附上您的JS文件,其中有错误occures@AkilaDevinda它在
exceptionmanager.js
中,它的一般错误处理类I假定为是,但错误是未定义的变量名。我认为它来自您第一次加载JS文件。用“clean”名称检查代码。它没有定义。还要确保卸载应用程序并rebuild@AkilaDevinda谢谢你给我指出了正确的方向欢迎你,很高兴它能帮上忙:)附上你的JS文件哪个错误occures@AkilaDevinda它在exceptionmanager.js
中,它的一般错误处理类I假定为是,但错误是未定义的变量名。我认为它来自您第一次加载JS文件。用“clean”名称检查代码。它没有定义。还要确保卸载应用程序并rebuild@AkilaDevinda谢谢你给我指出了正确的方向你的欢迎,很高兴它能帮上忙
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js",
enableHermes: false, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
def jscFlavor = 'org.webkit:android-jsc:+'
def enableHermes = project.ext.react.get("enableHermes", false);
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize "3g"
}
defaultConfig {
applicationId "com.client"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.12"
missingDimensionStrategy 'react-native-camera', 'general'
multiDexEnabled true
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
}
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
packagingOptions {
pickFirst "lib/armeabi-v7a/libc++_shared.so"
pickFirst "lib/arm64-v8a/libc++_shared.so"
pickFirst "lib/x86/libc++_shared.so"
pickFirst "lib/x86_64/libc++_shared.so"
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'androidx.appcompat:appcompat:1.2.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.multidex:multidex:2.0.1'
implementation "com.google.android.gms:play-services-base:17.0.0"
implementation "com.google.firebase:firebase-core:17.0.1"
implementation "com.google.firebase:firebase-auth:17.0.0"
implementation "com.google.firebase:firebase-firestore:19.0.0"
implementation "com.google.firebase:firebase-messaging:19.0.0"
implementation "com.google.firebase:firebase-storage:17.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply plugin: 'com.google.gms.google-services'
module.exports = {
dependencies: {
'react-native-image-filter-kit': {
platforms: {
android: null, // disable Android platform, other platforms will still autolink if provided
},
},
}