admin管理员组文章数量:1332383
ERROR TypeError: Cannot read property 'style' of undefined, js engine: hermes
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes.
package.json
{
"name": "rasoi_rider",
"version": "2.2.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-munity/async-storage": "^1.11.0",
"@react-native-munity/geolocation": "^2.0.2",
"@react-native-munity/masked-view": "^0.1.11",
"@react-native-munity/toolbar-android": "^0.2.1",
"@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/native": "^6.0.6",
"@react-navigation/native-stack": "^6.2.5",
"@react-navigation/stack": "^6.0.11",
"@supersami/rn-foreground-service": "^2.1.0",
"axios": "^1.4.0",
"currency-formatter": "^1.5.9",
"i18next": "^21.6.3",
"install": "^0.13.0",
"lodash": "^4.17.21",
"lottie-react-native": "5.1.6",
"moment": "^2.29.1",
"npm": "^9.8.1",
"qs": "^6.10.2",
"react": "17.0.2",
"react-i18next": "^11.15.1",
"react-native": "^0.69.12",
"react-native-android-location-enabler": "1.2.2",
"react-native-elements": "^3.4.2",
"react-native-flash-message": "^0.2.0",
"react-native-geolocation-service": "^5.3.1",
"react-native-gesture-handler": "^2.15.0",
"react-native-htmlview": "^0.16.0",
"react-native-maps": "^0.30.1",
"react-native-modalize": "^2.0.13",
"react-native-onesignal": "^4.3.4",
"react-native-reanimated": "^2.17.0",
"react-native-restart": "^0.0.23",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.2",
"react-native-simple-toast": "^3.0.1",
"react-native-splash-screen": "^3.3.0",
"react-native-status-bar-height": "^2.6.0",
"react-native-swipe-list-view": "^3.2.9",
"react-native-vector-icons": "^9.0.0",
"react-redux": "^8.1.2",
"redux": "^4.2.1",
"socket.io-client": "^4.7.4"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-munity/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"prop-types": "^15.7.2",
"react-test-renderer": "17.0.2",
"redux-devtools-extension": "^2.13.9"
},
"jest": {
"preset": "react-native"
}
}
build.gradel(project level)
// Top-level build file where you can add configuration options mon to all sub-projects/modules.
def REACT_NATIVE_VERSION = new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
buildscript {
ext {
kotlinVersion = "1.7.0"
// buildToolsVersion = "30.0.2"
// buildToolsVersion = "30.0.3"
buildToolsVersion = "33.0.1"
// minSdkVersion = 21
// pileSdkVersion = 31
// targetSdkVersion = 30
minSdkVersion = 23
pileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = "21.4.7075529"
playServicesVersion = "17.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath('.android.tools.build:gradle:7.4.2')
classpath('.google.gms:google-services:4.3.10')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
configurations.all {
resolutionStrategy {
force ".facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
repositories {
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")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup ".facebook.react"
}
}
google()
jcenter()
maven { url '' }
}
}
build.gradle(app level)
buildscript {
repositories {
maven { url '/' } // Gradle Plugin Portal
}
dependencies {
classpath 'gradle.plugin.onesignal:onesignal-gradle-plugin:[0.12.6, 0.99.99]'
}
}
apply plugin: '.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: ".android.application"
import .android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // // /docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
// entryFile: "index.js" ,
enableHermes: true
// enableHermes: true, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be piled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
/**
* Architectures to build native code for in debug.
*/
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
android {
ndkVersion rootProject.ext.ndkVersion
pileSdkVersion rootProject.extpileSdkVersion
defaultConfig {
applicationId ".rasoirider"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2
versionName '1.0.1'
configurations.all {
resolutionStrategy { force 'androidx.work:work-runtime:2.6.0' }
}
}
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
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}
release {
// Caution! In production, you need to generate your own keystore file.
// see /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"
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'
exclude("META-INF/*.kotlin_module")
pickFirst 'lib/armeabi-v7a/libfbjni.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libfbjni.so'
pickFirst 'lib/x86_64/libfbjni.so'
pickFirst 'lib/x86/libfbjni.so'
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/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:
// .html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
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 =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}
}
}
}
dependencies {
implementation 'androidx.work:work-runtime:2.7.0-alpha05'
// For Kotlin
implementation 'androidx.work:work-runtime-ktx:2.7.0-alpha05'
// implementation '.facebook.soloader:soloader:0.9.0+'
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation ".facebook.react:react-native:+" // From node_modules
implementation project(':react-native-android-location-enabler')
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
// implementation project(':react-native-toast-native')
debugImplementation(".facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group: '.facebook.fbjni'
}
debugImplementation(".facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group: '.facebook.flipper'
exclude group: '.squareup.okhttp3', module: 'okhttp'
}
debugImplementation(".facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group: '.facebook.flipper'
}
implementation(project(':react-native-maps')) {
exclude group: '.google.android.gms', module: 'play-services-base'
exclude group: '.google.android.gms', module: 'play-services-maps'
}
implementation '.google.android.gms:play-services-base:17.2.1'
implementation '.google.android.gms:play-services-maps:17.0.0'
implementation project(':react-native-munity-geolocation');
if (enableHermes) {
implementation(".facebook.react:hermes-engine:+") {
exclude group: '.facebook.fbjni'
}
// 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 pile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.implementation
into 'libs'
}
apply from: file("../../node_modules/@react-native-munity/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
ERROR TypeError: Cannot read property 'style' of undefined, js engine: hermes
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes.
package.json
{
"name": "rasoi_rider",
"version": "2.2.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-munity/async-storage": "^1.11.0",
"@react-native-munity/geolocation": "^2.0.2",
"@react-native-munity/masked-view": "^0.1.11",
"@react-native-munity/toolbar-android": "^0.2.1",
"@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/native": "^6.0.6",
"@react-navigation/native-stack": "^6.2.5",
"@react-navigation/stack": "^6.0.11",
"@supersami/rn-foreground-service": "^2.1.0",
"axios": "^1.4.0",
"currency-formatter": "^1.5.9",
"i18next": "^21.6.3",
"install": "^0.13.0",
"lodash": "^4.17.21",
"lottie-react-native": "5.1.6",
"moment": "^2.29.1",
"npm": "^9.8.1",
"qs": "^6.10.2",
"react": "17.0.2",
"react-i18next": "^11.15.1",
"react-native": "^0.69.12",
"react-native-android-location-enabler": "1.2.2",
"react-native-elements": "^3.4.2",
"react-native-flash-message": "^0.2.0",
"react-native-geolocation-service": "^5.3.1",
"react-native-gesture-handler": "^2.15.0",
"react-native-htmlview": "^0.16.0",
"react-native-maps": "^0.30.1",
"react-native-modalize": "^2.0.13",
"react-native-onesignal": "^4.3.4",
"react-native-reanimated": "^2.17.0",
"react-native-restart": "^0.0.23",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.2",
"react-native-simple-toast": "^3.0.1",
"react-native-splash-screen": "^3.3.0",
"react-native-status-bar-height": "^2.6.0",
"react-native-swipe-list-view": "^3.2.9",
"react-native-vector-icons": "^9.0.0",
"react-redux": "^8.1.2",
"redux": "^4.2.1",
"socket.io-client": "^4.7.4"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-munity/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"prop-types": "^15.7.2",
"react-test-renderer": "17.0.2",
"redux-devtools-extension": "^2.13.9"
},
"jest": {
"preset": "react-native"
}
}
build.gradel(project level)
// Top-level build file where you can add configuration options mon to all sub-projects/modules.
def REACT_NATIVE_VERSION = new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
buildscript {
ext {
kotlinVersion = "1.7.0"
// buildToolsVersion = "30.0.2"
// buildToolsVersion = "30.0.3"
buildToolsVersion = "33.0.1"
// minSdkVersion = 21
// pileSdkVersion = 31
// targetSdkVersion = 30
minSdkVersion = 23
pileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = "21.4.7075529"
playServicesVersion = "17.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath('.android.tools.build:gradle:7.4.2')
classpath('.google.gms:google-services:4.3.10')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
configurations.all {
resolutionStrategy {
force ".facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
repositories {
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")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup ".facebook.react"
}
}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
build.gradle(app level)
buildscript {
repositories {
maven { url 'https://plugins.gradle/m2/' } // Gradle Plugin Portal
}
dependencies {
classpath 'gradle.plugin..onesignal:onesignal-gradle-plugin:[0.12.6, 0.99.99]'
}
}
apply plugin: '.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: ".android.application"
import .android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android./tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
// entryFile: "index.js" ,
enableHermes: true
// enableHermes: true, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be piled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
/**
* Architectures to build native code for in debug.
*/
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
android {
ndkVersion rootProject.ext.ndkVersion
pileSdkVersion rootProject.ext.pileSdkVersion
defaultConfig {
applicationId ".rasoirider"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2
versionName '1.0.1'
configurations.all {
resolutionStrategy { force 'androidx.work:work-runtime:2.6.0' }
}
}
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
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/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"
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'
exclude("META-INF/*.kotlin_module")
pickFirst 'lib/armeabi-v7a/libfbjni.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libfbjni.so'
pickFirst 'lib/x86_64/libfbjni.so'
pickFirst 'lib/x86/libfbjni.so'
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/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./studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
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 =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}
}
}
}
dependencies {
implementation 'androidx.work:work-runtime:2.7.0-alpha05'
// For Kotlin
implementation 'androidx.work:work-runtime-ktx:2.7.0-alpha05'
// implementation '.facebook.soloader:soloader:0.9.0+'
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation ".facebook.react:react-native:+" // From node_modules
implementation project(':react-native-android-location-enabler')
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
// implementation project(':react-native-toast-native')
debugImplementation(".facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group: '.facebook.fbjni'
}
debugImplementation(".facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group: '.facebook.flipper'
exclude group: '.squareup.okhttp3', module: 'okhttp'
}
debugImplementation(".facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group: '.facebook.flipper'
}
implementation(project(':react-native-maps')) {
exclude group: '.google.android.gms', module: 'play-services-base'
exclude group: '.google.android.gms', module: 'play-services-maps'
}
implementation '.google.android.gms:play-services-base:17.2.1'
implementation '.google.android.gms:play-services-maps:17.0.0'
implementation project(':react-native-munity-geolocation');
if (enableHermes) {
implementation(".facebook.react:hermes-engine:+") {
exclude group: '.facebook.fbjni'
}
// 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 pile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.implementation
into 'libs'
}
apply from: file("../../node_modules/@react-native-munity/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
Share
asked Mar 1, 2024 at 5:05
sanjay solankisanjay solanki
691 gold badge1 silver badge6 bronze badges
2 Answers
Reset to default 2This is JS related error not a native error, you may using someObject.style
some where in the code. and here someObject is undefined at that place.
You can try to start metro server with reset cache option as below, this might show you exact line for this error.
yarn start --reset-cache
or you also can have a try to search for .style in your codebase with global search and make it optional to fix this issue.
In my case, the package react-native-smooth-pincode-input
was breaking an entire ponent that I use as a Screen
.
Looking into the package file, inside the node_modules
, I found that it uses ViewPropTypes
from react-native
. ViewPropTypes has been removed from react native.
本文标签: javascriptCannot read property 39style39 of undefinedjs engine hermesStack Overflow
版权声明:本文标题:javascript - Cannot read property 'style' of undefined, js engine: hermes - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742293817a2448321.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论