diff --git a/.github/workflows/android-build-custom-dev-app.yml b/.github/workflows/android-build-custom-dev-app.yml index e14256fa..0c60dfa7 100644 --- a/.github/workflows/android-build-custom-dev-app.yml +++ b/.github/workflows/android-build-custom-dev-app.yml @@ -28,6 +28,9 @@ jobs: - name: npm install run: npm ci + + - name: Make Hermes compiler executable (Linux) + run: chmod +x ./node_modules/react-native/node_modules/hermes-compiler/hermesc/linux64-bin/hermesc - name: Add NDK 27.3.13750724 run: echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;27.3.13750724" diff --git a/android/app/build.gradle b/android/app/build.gradle index dd5e357b..01d5909a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -3,6 +3,8 @@ apply plugin: "org.jetbrains.kotlin.android" apply plugin: "com.facebook.react" apply plugin: 'org.jetbrains.kotlin.plugin.compose' +import org.gradle.internal.os.OperatingSystem + /** * This is the configuration block to customize your React Native Android app. * By default you don't need to apply any configuration, just uncomment the lines you need. @@ -47,6 +49,20 @@ apply plugin: 'org.jetbrains.kotlin.plugin.compose' // // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" // hermesFlags = ["-O", "-output-source-map"] + + def hermescDir = file("${rootDir}/../node_modules/react-native/node_modules/hermes-compiler/hermesc") + def os = OperatingSystem.current() + + if (os.isMacOsX()) { + hermesCommand = "${hermescDir}/osx-bin/hermesc" + } else if (os.isLinux()) { + hermesCommand = "${hermescDir}/linux64-bin/hermesc" + } else if (os.isWindows()) { + hermesCommand = "${hermescDir}/win64-bin/hermesc.exe" + } else { + throw new GradleException("Unsupported OS for Hermes compiler: " + OperatingSystem.current()) + } + /* Autolinking */ autolinkLibrariesWithApp() } @@ -144,6 +160,7 @@ dependencies { configurations.all { resolutionStrategy { + force "com.facebook.hermes:hermes-android:${rootProject.ext.hermesVersion}" force "androidx.annotation:annotation:1.1.0" force( "com.google.android.gms:play-services-base:18.6.0", diff --git a/android/build.gradle b/android/build.gradle index fb373556..143e82cb 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,9 @@ buildscript { ext { + hermesVersion = new groovy.json.JsonSlurper() + .parse(file("../package.json")) + .overrides["hermes-compiler"] + buildToolsVersion = "36.0.0" minSdkVersion = 29 compileSdkVersion = 36 diff --git a/android/gradle.properties b/android/gradle.properties index f6f385d6..2bbe2184 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -24,7 +24,7 @@ android.nonTransitiveRClass=true android.suppressUnsupportedCompileSdk=33 newArchEnabled=true hermesEnabled=true -hermesV1Enabled=false +hermesV1Enabled=true mendixnative.cookieEncryption=false VisionCamera_enableCodeScanner=true diff --git a/ios/Podfile b/ios/Podfile index a4e1f3fc..d9299de6 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -16,9 +16,6 @@ ENV['RCT_NEW_ARCH_ENABLED'] = '1' ENV['RCT_USE_PREBUILT_RNCORE'] = '1' ENV['RCT_USE_RN_DEP'] = '1' -# The JS bundle is compiled compiled using a different version than the prebuilt Hermes engine embedded in the native binary, causing a runtime crash. -ENV['RCT_HERMES_V1_ENABLED'] = '0' - # Use it to require both react-native's and this package's scripts: node_require('react-native/scripts/react_native_pods.rb') node_require('react-native-permissions/scripts/setup.rb') diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 368ee25f..d1f19f01 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,8 +1,8 @@ PODS: - FBLazyVector (0.84.1) - - hermes-engine (0.15.1): - - hermes-engine/Pre-built (= 0.15.1) - - hermes-engine/Pre-built (0.15.1) + - hermes-engine (250829098.0.9): + - hermes-engine/Pre-built (= 250829098.0.9) + - hermes-engine/Pre-built (250829098.0.9) - IQKeyboardManager (6.5.19) - libavif/core (0.11.1) - libavif/libdav1d (0.11.1): @@ -69,7 +69,7 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - OpenSSL-Universal (3.6.0000) + - OpenSSL-Universal (3.6.2000) - RCTDeprecation (0.84.1) - RCTRequired (0.84.1) - RCTSwiftUI (0.84.1) @@ -2666,7 +2666,7 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/FBLazyVector" hermes-engine: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" - :tag: hermes-v0.15.1 + :tag: hermes-v250829098.0.9 MendixNative: :path: "../node_modules/mendix-native" op-sqlite: @@ -2862,14 +2862,14 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: FBLazyVector: e97c19a5a442429d1988f182a1940fb08df514da - hermes-engine: e171ce5eb126654bf3fe00c8c6ac64370354a6c7 + hermes-engine: 054cdf1294d0852c33cd980e7fcd94b4274ed8b3 IQKeyboardManager: c8665b3396bd0b79402b4c573eac345a31c7d485 libavif: 84bbb62fb232c3018d6f1bab79beea87e35de7b7 libdav1d: 23581a4d8ec811ff171ed5e2e05cd27bad64c39f libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8 MendixNative: b0ea153b893ce40b90016f397e9a5acfe4444c33 op-sqlite: e9ef65bcf95a97863874cee87841425bb71c8396 - OpenSSL-Universal: 9110d21982bb7e8b22a962b6db56a8aa805afde7 + OpenSSL-Universal: ecee7b138fa75a74ecf00d7ffd248fb584739b9e RCTDeprecation: af44b104091a34482596cd9bd7e8d90c4e9b4bd7 RCTRequired: bb77b070f75f53398ce43c0aaaa58337cebe2bf6 RCTSwiftUI: afc0a0a635860da1040a0b894bfd529da06d7810 @@ -2962,7 +2962,7 @@ SPEC CHECKSUMS: RNReanimated: e47df7f4580997c3a46b1e736ce3f26010985bb7 RNScreens: 6cb648bdad8fe9bee9259fe144df95b6d1d5b707 RNSVG: c69f7709226108f5eb89b5aa8833c17a36345468 - RNWorklets: 7d24538032e023ed207e3b4d9b234695ddadd201 + RNWorklets: 06ce05d69455cc14f5676c177050a39aa557d4d2 SDWebImage: e9fc87c1aab89a8ab1bbd74eba378c6f53be8abf SDWebImageAVIFCoder: afe194a084e851f70228e4be35ef651df0fc5c57 SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c @@ -2971,6 +2971,6 @@ SPEC CHECKSUMS: SwiftAudioEx: f6aa653770f3a0d3851edaf8d834a30aee4a7646 Yoga: c0b3f2c7e8d3e327e450223a2414ca3fa296b9a2 -PODFILE CHECKSUM: 7a33012cce520784bb5b691549f5ed2af273b7e3 +PODFILE CHECKSUM: 336902a926a1c6b0b4e426a1eeb85e04f7bbf783 COCOAPODS: 1.16.2 diff --git a/package-lock.json b/package-lock.json index a8c0735a..8098ccd8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5207,12 +5207,6 @@ "he": "bin/he" } }, - "node_modules/hermes-compiler": { - "version": "250829098.0.9", - "resolved": "https://registry.npmjs.org/hermes-compiler/-/hermes-compiler-250829098.0.9.tgz", - "integrity": "sha512-hZ5O7PDz1vQ99TS7HD3FJ9zVynfU1y+VWId6U1Pldvd8hmAYrNec/XLPYJKD3dLOW6NXak6aAQAuMuSo3ji0tQ==", - "license": "MIT" - }, "node_modules/hermes-estree": { "version": "0.32.0", "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.32.0.tgz", @@ -8318,6 +8312,12 @@ "node": ">=18" } }, + "node_modules/react-native/node_modules/hermes-compiler": { + "version": "250829098.0.14", + "resolved": "https://registry.npmjs.org/hermes-compiler/-/hermes-compiler-250829098.0.14.tgz", + "integrity": "sha512-5meXwsZxgiqFaJjNzwjzI9IyUkuGGBisu+z9BvQWmGVpjH6nz11hgqkyxe4dl8UAdyIV4lTbz91+Dlnjz0VxqA==", + "license": "MIT" + }, "node_modules/react-native/node_modules/ws": { "version": "7.5.10", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", diff --git a/package.json b/package.json index f568e50d..c795e802 100644 --- a/package.json +++ b/package.json @@ -60,12 +60,14 @@ "react": "19.2.3", "react-dom": "19.2.3", "react-native": "0.84.1", + "hermes-compiler": "250829098.0.14", "unset-value": "2.0.1", "semver": "7.7.4" }, "resolutions": { "react": "19.2.3", "react-dom": "19.2.3", - "react-native": "0.84.1" + "react-native": "0.84.1", + "hermes-compiler": "250829098.0.14" } }