feat: fixing build on RN 0.79+

This commit is contained in:
Hugo EXTRAT 2025-08-25 09:24:04 +02:00
parent a951a18d8d
commit 933fd0d317
No known key found for this signature in database
GPG Key ID: 9A1C6BCBF89ECB2A
4 changed files with 4 additions and 51 deletions

View File

@ -15,7 +15,6 @@ buildscript {
}
}
def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}
@ -31,26 +30,7 @@ def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RateApp_" + name]).toInteger()
}
def supportsNamespace() {
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
def major = parsed[0].toInteger()
def minor = parsed[1].toInteger()
// Namespace support was added in 7.3.0
return (major == 7 && minor >= 3) || major >= 8
}
android {
if (supportsNamespace()) {
namespace "com.rateapp"
sourceSets {
main {
manifest.srcFile "src/main/AndroidManifestNew.xml"
}
}
}
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
defaultConfig {
@ -104,12 +84,4 @@ dependencies {
implementation "com.facebook.react:react-android"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.google.android.play:review:2.0.1"
}
if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
libraryName = "RateApp"
codegenJavaPackageName = "com.rateapp"
}
}
}

View File

@ -1,5 +1,5 @@
#ifdef RCT_NEW_ARCH_ENABLED
#import "generated/RateAppSpec/RateAppSpec.h"
#import "RateAppSpec/RateAppSpec.h"
@interface RateApp : NSObject <NativeRateAppSpec>
#else

View File

@ -14,7 +14,6 @@
"ios",
"cpp",
"*.podspec",
"react-native.config.js",
"!ios/build",
"!android/build",
"!android/gradle",
@ -126,7 +125,6 @@
"source": "src",
"output": "lib",
"targets": [
"codegen",
"commonjs",
"module",
"typescript"
@ -136,18 +134,13 @@
"name": "RateAppSpec",
"type": "modules",
"jsSrcsDir": "./src/codegenSpec",
"outputDir": {
"ios": "ios/generated",
"android": "android/generated"
},
"android": {
"javaPackageName": "com.rateapp"
},
"includesGeneratedCode": true
}
},
"create-react-native-library": {
"type": "turbo-module",
"languages": "kotlin-objc",
"version": "0.50.3"
"version": "0.52.1"
}
}

View File

@ -1,12 +0,0 @@
/**
* @type {import('@react-native-community/cli-types').UserDependencyConfig}
*/
module.exports = {
dependency: {
platforms: {
android: {
cmakeListsPath: 'generated/jni/CMakeLists.txt',
},
},
},
};