From e770200876d29335a80ee274952c87c5409c1460 Mon Sep 17 00:00:00 2001 From: Kevin Herembourg Date: Fri, 27 Feb 2026 17:50:21 +0100 Subject: [PATCH 1/6] fix(android-player): remove unused codegen block causing build failure The `react { jsRootDir = file("../src/") }` block in build.gradle triggered React Native codegen to look for a `src/` directory that is not included in the published npm package, causing Android builds to fail with ENOENT on `generateCodegenSchemaFromJavaScript`. Since android-player has no Turbo Module specs (it uses NativeModules, the old architecture bridge), the codegen block was both unnecessary and broken. Removing it and the related `isNewArchitectureEnabled()` helper fixes the build for all consumers without any loss of functionality. Fixes: https://github.com/Purchasely/Purchasely-ReactNative/pull/213#issuecomment Co-Authored-By: Claude Sonnet 4.6 --- packages/android-player/android/build.gradle | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/packages/android-player/android/build.gradle b/packages/android-player/android/build.gradle index c8522bf..fa427c6 100644 --- a/packages/android-player/android/build.gradle +++ b/packages/android-player/android/build.gradle @@ -16,17 +16,9 @@ buildscript { } } -def isNewArchitectureEnabled() { - return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" -} - apply plugin: 'com.android.library' apply plugin: 'kotlin-android' -if (isNewArchitectureEnabled()) { - apply plugin: 'com.facebook.react' -} - def getExtOrDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['PurchaselyAndroidPlayer_' + name] } @@ -42,7 +34,6 @@ android { targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') versionCode 1 versionName "1.0" - buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() } buildTypes { @@ -140,12 +131,3 @@ dependencies { implementation 'io.purchasely:player:5.7.0' } - - -if (isNewArchitectureEnabled()) { - react { - jsRootDir = file("../src/") - libraryName = "PurchaselyAndroidPlayer" - codegenJavaPackageName = "com.reactnativepurchaselyandroidplayer" - } -} From f8641592c8e3392a05480dd94ed1638f8911c803 Mon Sep 17 00:00:00 2001 From: Kevin Herembourg Date: Fri, 27 Feb 2026 23:24:19 +0100 Subject: [PATCH 2/6] fix(android-player): correct gradle.properties prefix and remove stale turbo env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gradle.properties used PurchaselyGoogle_ prefix while build.gradle reads PurchaselyAndroidPlayer_ — causing NPE on standalone builds. turbo.json declared ORG_GRADLE_PROJECT_newArchEnabled (removed with the codegen block) and a build:ios task irrelevant for this Android-only package. Co-Authored-By: Claude Sonnet 4.6 --- .../android-player/android/gradle.properties | 6 +++--- packages/android-player/turbo.json | 16 ---------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/packages/android-player/android/gradle.properties b/packages/android-player/android/gradle.properties index 3672553..1d56d66 100644 --- a/packages/android-player/android/gradle.properties +++ b/packages/android-player/android/gradle.properties @@ -1,6 +1,6 @@ -PurchaselyGoogle_kotlinVersion=2.1.21 -PurchaselyGoogle_compileSdkVersion=35 -PurchaselyGoogle_targetSdkVersion=35 +PurchaselyAndroidPlayer_kotlinVersion=2.1.21 +PurchaselyAndroidPlayer_compileSdkVersion=35 +PurchaselyAndroidPlayer_targetSdkVersion=35 android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX diff --git a/packages/android-player/turbo.json b/packages/android-player/turbo.json index 405897e..162fba0 100644 --- a/packages/android-player/turbo.json +++ b/packages/android-player/turbo.json @@ -2,7 +2,6 @@ "$schema": "https://turbo.build/schema.json", "pipeline": { "build:android": { - "env": ["ORG_GRADLE_PROJECT_newArchEnabled"], "inputs": [ "package.json", "android", @@ -16,21 +15,6 @@ "!example/android/app/build" ], "outputs": [] - }, - "build:ios": { - "env": ["RCT_NEW_ARCH_ENABLED"], - "inputs": [ - "package.json", - "*.podspec", - "ios", - "src/*.ts", - "src/*.tsx", - "example/package.json", - "example/ios", - "!example/ios/build", - "!example/ios/Pods" - ], - "outputs": [] } } } From 2ef60c013d5921e665c1fc9aef3687e2ba46c474 Mon Sep 17 00:00:00 2001 From: Kevin Herembourg Date: Fri, 27 Feb 2026 23:24:28 +0100 Subject: [PATCH 3/6] refactor(android): modernise satellite packages build.gradle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For all four satellite packages (android-player, google, amazon, huawei): - AGP: 7.3.1 → 8.7.3 (aligns with main purchasely package) - Java/Kotlin: VERSION_1_8 → VERSION_11, add kotlinOptions jvmTarget=11 - Add namespace declaration to android{} block (required by AGP 8+) - Replace dead 64-line RN source-lookup block with google()/mavenCentral() The lookup was superseded by RNGP in RN 0.71; confirmed present in example/android/settings.gradle - Remove jcenter() (shut down Feb 2022) - Keep mavenLocal() in buildscript repos for local library development - Preserve Huawei-specific Maven repo and agcp classpath in huawei package Co-Authored-By: Claude Sonnet 4.6 --- packages/amazon/android/build.gradle | 80 ++----------------- packages/android-player/android/build.gradle | 82 +++---------------- packages/google/android/build.gradle | 83 +++----------------- packages/huawei/android/build.gradle | 80 ++----------------- 4 files changed, 34 insertions(+), 291 deletions(-) diff --git a/packages/amazon/android/build.gradle b/packages/amazon/android/build.gradle index 835ed6e..52d444f 100644 --- a/packages/amazon/android/build.gradle +++ b/packages/amazon/android/build.gradle @@ -5,11 +5,10 @@ buildscript { repositories { google() mavenCentral() - jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.android.tools.build:gradle:8.7.3' // noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } @@ -27,13 +26,13 @@ def getExtOrIntegerDefault(name) { } android { + namespace = "com.reactnativepurchaselyamazon" compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') defaultConfig { minSdkVersion 21 targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') versionCode 1 versionName "1.0" - } buildTypes { @@ -45,80 +44,17 @@ android { disable 'GradleCompatible' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" } } repositories { - mavenCentral() - jcenter() google() - - def found = false - def defaultDir = null - def androidSourcesName = 'React Native sources' - - if (rootProject.ext.has('reactNativeAndroidRoot')) { - defaultDir = rootProject.ext.get('reactNativeAndroidRoot') - } else { - defaultDir = new File( - projectDir, - '/../../../node_modules/react-native/android' - ) - } - - if (defaultDir.exists()) { - maven { - url defaultDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}") - found = true - } else { - def parentDir = rootProject.projectDir - - 1.upto(5, { - if (found) return true - parentDir = parentDir.parentFile - - def androidSourcesDir = new File( - parentDir, - 'node_modules/react-native' - ) - - def androidPrebuiltBinaryDir = new File( - parentDir, - 'node_modules/react-native/android' - ) - - if (androidPrebuiltBinaryDir.exists()) { - maven { - url androidPrebuiltBinaryDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}") - found = true - } else if (androidSourcesDir.exists()) { - maven { - url androidSourcesDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}") - found = true - } - }) - } - - if (!found) { - throw new GradleException( - "${project.name}: unable to locate React Native android sources. " + - "Ensure you have you installed React Native as a dependency in your project and try again." - ) - } + mavenCentral() } def kotlin_version = getExtOrDefault('kotlinVersion') diff --git a/packages/android-player/android/build.gradle b/packages/android-player/android/build.gradle index fa427c6..1a7834f 100644 --- a/packages/android-player/android/build.gradle +++ b/packages/android-player/android/build.gradle @@ -4,13 +4,12 @@ buildscript { repositories { google() - mavenCentral() - jcenter() mavenLocal() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.android.tools.build:gradle:8.7.3' // noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } @@ -28,6 +27,7 @@ def getExtOrIntegerDefault(name) { } android { + namespace = "com.reactnativepurchaselyandroidplayer" compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') defaultConfig { minSdkVersion 21 @@ -45,81 +45,17 @@ android { disable 'GradleCompatible' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" } } repositories { - mavenCentral() - jcenter() google() - mavenLocal() - - def found = false - def defaultDir = null - def androidSourcesName = 'React Native sources' - - if (rootProject.ext.has('reactNativeAndroidRoot')) { - defaultDir = rootProject.ext.get('reactNativeAndroidRoot') - } else { - defaultDir = new File( - projectDir, - '/../../../node_modules/react-native/android' - ) - } - - if (defaultDir.exists()) { - maven { - url defaultDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}") - found = true - } else { - def parentDir = rootProject.projectDir - - 1.upto(5, { - if (found) return true - parentDir = parentDir.parentFile - - def androidSourcesDir = new File( - parentDir, - 'node_modules/react-native' - ) - - def androidPrebuiltBinaryDir = new File( - parentDir, - 'node_modules/react-native/android' - ) - - if (androidPrebuiltBinaryDir.exists()) { - maven { - url androidPrebuiltBinaryDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}") - found = true - } else if (androidSourcesDir.exists()) { - maven { - url androidSourcesDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}") - found = true - } - }) - } - - if (!found) { - throw new GradleException( - "${project.name}: unable to locate React Native android sources. " + - "Ensure you have you installed React Native as a dependency in your project and try again." - ) - } + mavenCentral() } def kotlin_version = getExtOrDefault('kotlinVersion') diff --git a/packages/google/android/build.gradle b/packages/google/android/build.gradle index 098a7c7..da2fa5b 100644 --- a/packages/google/android/build.gradle +++ b/packages/google/android/build.gradle @@ -4,13 +4,12 @@ buildscript { repositories { google() - mavenCentral() - jcenter() mavenLocal() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.android.tools.build:gradle:8.7.3' // noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } @@ -28,13 +27,13 @@ def getExtOrIntegerDefault(name) { } android { + namespace = "com.reactnativepurchaselygoogle" compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') defaultConfig { minSdkVersion 21 targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') versionCode 1 versionName "1.0" - } buildTypes { @@ -46,81 +45,17 @@ android { disable 'GradleCompatible' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" } } repositories { - mavenCentral() - jcenter() google() - mavenLocal() - - def found = false - def defaultDir = null - def androidSourcesName = 'React Native sources' - - if (rootProject.ext.has('reactNativeAndroidRoot')) { - defaultDir = rootProject.ext.get('reactNativeAndroidRoot') - } else { - defaultDir = new File( - projectDir, - '/../../../node_modules/react-native/android' - ) - } - - if (defaultDir.exists()) { - maven { - url defaultDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}") - found = true - } else { - def parentDir = rootProject.projectDir - - 1.upto(5, { - if (found) return true - parentDir = parentDir.parentFile - - def androidSourcesDir = new File( - parentDir, - 'node_modules/react-native' - ) - - def androidPrebuiltBinaryDir = new File( - parentDir, - 'node_modules/react-native/android' - ) - - if (androidPrebuiltBinaryDir.exists()) { - maven { - url androidPrebuiltBinaryDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}") - found = true - } else if (androidSourcesDir.exists()) { - maven { - url androidSourcesDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}") - found = true - } - }) - } - - if (!found) { - throw new GradleException( - "${project.name}: unable to locate React Native android sources. " + - "Ensure you have you installed React Native as a dependency in your project and try again." - ) - } + mavenCentral() } def kotlin_version = getExtOrDefault('kotlinVersion') diff --git a/packages/huawei/android/build.gradle b/packages/huawei/android/build.gradle index 294b33c..c5be276 100644 --- a/packages/huawei/android/build.gradle +++ b/packages/huawei/android/build.gradle @@ -5,12 +5,11 @@ buildscript { repositories { google() mavenCentral() - jcenter() maven { url 'https://developer.huawei.com/repo/' } } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.android.tools.build:gradle:8.7.3' // noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.huawei.agconnect:agcp:1.6.0.300' @@ -30,13 +29,13 @@ def getExtOrIntegerDefault(name) { } android { + namespace = "com.reactnativepurchaselyhuawei" compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') defaultConfig { minSdkVersion 21 targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') versionCode 1 versionName "1.0" - } buildTypes { @@ -48,81 +47,18 @@ android { disable 'GradleCompatible' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" } } repositories { - mavenCentral() - jcenter() google() + mavenCentral() maven { url 'https://developer.huawei.com/repo/' } - - def found = false - def defaultDir = null - def androidSourcesName = 'React Native sources' - - if (rootProject.ext.has('reactNativeAndroidRoot')) { - defaultDir = rootProject.ext.get('reactNativeAndroidRoot') - } else { - defaultDir = new File( - projectDir, - '/../../../node_modules/react-native/android' - ) - } - - if (defaultDir.exists()) { - maven { - url defaultDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}") - found = true - } else { - def parentDir = rootProject.projectDir - - 1.upto(5, { - if (found) return true - parentDir = parentDir.parentFile - - def androidSourcesDir = new File( - parentDir, - 'node_modules/react-native' - ) - - def androidPrebuiltBinaryDir = new File( - parentDir, - 'node_modules/react-native/android' - ) - - if (androidPrebuiltBinaryDir.exists()) { - maven { - url androidPrebuiltBinaryDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}") - found = true - } else if (androidSourcesDir.exists()) { - maven { - url androidSourcesDir.toString() - name androidSourcesName - } - - logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}") - found = true - } - }) - } - - if (!found) { - throw new GradleException( - "${project.name}: unable to locate React Native android sources. " + - "Ensure you have you installed React Native as a dependency in your project and try again." - ) - } } def kotlin_version = getExtOrDefault('kotlinVersion') From e70928f8da89d3853431a5f128e1b901fabadd2e Mon Sep 17 00:00:00 2001 From: Kevin Herembourg Date: Fri, 27 Feb 2026 23:24:33 +0100 Subject: [PATCH 4/6] fix(android-player): correct package.json metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - source field: ./src/index.tsx → ./src/index.ts (file has no JSX) - repository.url: packages/google → packages/android-player (copy-paste leftover) - homepage: same correction Co-Authored-By: Claude Sonnet 4.6 --- packages/android-player/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/android-player/package.json b/packages/android-player/package.json index d50ef9b..25a1867 100644 --- a/packages/android-player/package.json +++ b/packages/android-player/package.json @@ -2,7 +2,7 @@ "name": "@purchasely/react-native-purchasely-android-player", "version": "5.7.0", "description": "Player Android", - "source": "./src/index.tsx", + "source": "./src/index.ts", "main": "./lib/commonjs/index.js", "module": "./lib/module/index.js", "types": "./lib/typescript/packages/android-player/src/index.d.ts", @@ -33,14 +33,14 @@ ], "repository": { "type": "git", - "url": "https://github.com/Purchasely/Purchasely-ReactNative/packages/google" + "url": "https://github.com/Purchasely/Purchasely-ReactNative/packages/android-player" }, "author": "Purchasely (https://github.com/Purchasely/Purchasely-ReactNative)", "license": "MIT", "bugs": { "url": "https://github.com/Purchasely/Purchasely-ReactNative/issues" }, - "homepage": "https://github.com/Purchasely/Purchasely-ReactNative/packages/google#readme", + "homepage": "https://github.com/Purchasely/Purchasely-ReactNative/packages/android-player#readme", "publishConfig": { "registry": "https://registry.npmjs.org/" }, From 0e81258a904bb218b9994dbd53df3261f04346c9 Mon Sep 17 00:00:00 2001 From: Kevin Herembourg Date: Fri, 27 Feb 2026 23:24:38 +0100 Subject: [PATCH 5/6] refactor(satellite-packages): remove multiply scaffold stub from TypeScript API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All four satellite packages (android-player, google, amazon, huawei) exported a multiply(a, b) function that was leftover from the React Native library template. These packages function as native dependency carriers — they bring in store-specific Gradle dependencies. No JavaScript API is needed. Also fixes huawei/src/index.ts which incorrectly referenced PurchaselyGoogle instead of PurchaselyHuawei. Co-Authored-By: Claude Sonnet 4.6 --- packages/amazon/src/index.ts | 25 +++---------------------- packages/android-player/src/index.ts | 23 +++-------------------- packages/google/src/index.ts | 24 +++--------------------- packages/huawei/src/index.ts | 24 +++--------------------- 4 files changed, 12 insertions(+), 84 deletions(-) diff --git a/packages/amazon/src/index.ts b/packages/amazon/src/index.ts index defee01..90b7806 100644 --- a/packages/amazon/src/index.ts +++ b/packages/amazon/src/index.ts @@ -1,22 +1,3 @@ -import { NativeModules, Platform } from 'react-native'; - -const LINKING_ERROR = - `The package 'react-native-purchasely-amazon' doesn't seem to be linked. Make sure: \n\n` + - Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + - '- You rebuilt the app after installing the package\n' + - '- You are not using Expo managed workflow\n'; - -const PurchaselyAmazon = NativeModules.PurchaselyAmazon - ? NativeModules.PurchaselyAmazon - : new Proxy( - {}, - { - get() { - throw new Error(LINKING_ERROR); - }, - } - ); - -export function multiply(a: number, b: number): Promise { - return PurchaselyAmazon.multiply(a, b); -} +// This package provides the Purchasely Amazon Appstore SDK as a native dependency. +// No JavaScript API is exposed by this package. +export {} diff --git a/packages/android-player/src/index.ts b/packages/android-player/src/index.ts index 47225ba..dba4bba 100644 --- a/packages/android-player/src/index.ts +++ b/packages/android-player/src/index.ts @@ -1,20 +1,3 @@ -import { NativeModules, Platform } from 'react-native'; - -const LINKING_ERROR = - `The package 'react-native-purchasely-android-player' doesn't seem to be linked. Make sure: \n\n` + - Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) + - '- You rebuilt the app after installing the package\n' + - '- You are not using Expo managed workflow\n'; - -const PurchaselyAndroidPlayer = NativeModules.PurchaselyAndroidPlayer ? NativeModules.PurchaselyAndroidPlayer : new Proxy( - {}, - { - get() { - throw new Error(LINKING_ERROR); - }, - } -); - -export function multiply(a: number, b: number): Promise { - return PurchaselyAndroidPlayer.multiply(a, b); -} +// This package provides the Purchasely Android Player SDK as a native dependency. +// No JavaScript API is exposed by this package. +export {} diff --git a/packages/google/src/index.ts b/packages/google/src/index.ts index 116d2d2..49f00b6 100644 --- a/packages/google/src/index.ts +++ b/packages/google/src/index.ts @@ -1,21 +1,3 @@ -import { NativeModules } from 'react-native'; - -const LINKING_ERROR = - `The package 'react-native-purchasely-google' doesn't seem to be linked. Make sure: \n\n` + - '- You rebuilt the app after installing the package\n' + - '- You are not using Expo managed workflow\n'; - -const PurchaselyGoogle = NativeModules.PurchaselyGoogle - ? NativeModules.PurchaselyGoogle - : new Proxy( - {}, - { - get() { - throw new Error(LINKING_ERROR); - }, - } - ); - -export function multiply(a: number, b: number): Promise { - return PurchaselyGoogle.multiply(a, b); -} +// This package provides the Purchasely Google Play Billing SDK as a native dependency. +// No JavaScript API is exposed by this package. +export {} diff --git a/packages/huawei/src/index.ts b/packages/huawei/src/index.ts index 116d2d2..64d7057 100644 --- a/packages/huawei/src/index.ts +++ b/packages/huawei/src/index.ts @@ -1,21 +1,3 @@ -import { NativeModules } from 'react-native'; - -const LINKING_ERROR = - `The package 'react-native-purchasely-google' doesn't seem to be linked. Make sure: \n\n` + - '- You rebuilt the app after installing the package\n' + - '- You are not using Expo managed workflow\n'; - -const PurchaselyGoogle = NativeModules.PurchaselyGoogle - ? NativeModules.PurchaselyGoogle - : new Proxy( - {}, - { - get() { - throw new Error(LINKING_ERROR); - }, - } - ); - -export function multiply(a: number, b: number): Promise { - return PurchaselyGoogle.multiply(a, b); -} +// This package provides the Purchasely Huawei Mobile Services SDK as a native dependency. +// No JavaScript API is exposed by this package. +export {} From b61ca8e871b64cf2c1e0d7fe1f05c29df1aa2505 Mon Sep 17 00:00:00 2001 From: Kevin Herembourg Date: Fri, 27 Feb 2026 23:43:20 +0100 Subject: [PATCH 6/6] fix(android): remove explicit kotlinOptions jvmTarget to fix JVM target mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With AGP 8 and JDK 17 in CI, javac targets 17 while kotlinOptions jvmTarget=11 caused: "Inconsistent JVM-target compatibility (17 vs 11)". Remove explicit jvmTarget — AGP automatically aligns Kotlin to match the Java compileOptions target, consistent with the main purchasely package. Co-Authored-By: Claude Sonnet 4.6 --- packages/amazon/android/build.gradle | 3 --- packages/android-player/android/build.gradle | 3 --- packages/google/android/build.gradle | 3 --- packages/huawei/android/build.gradle | 3 --- 4 files changed, 12 deletions(-) diff --git a/packages/amazon/android/build.gradle b/packages/amazon/android/build.gradle index 52d444f..d07d528 100644 --- a/packages/amazon/android/build.gradle +++ b/packages/amazon/android/build.gradle @@ -47,9 +47,6 @@ android { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } - kotlinOptions { - jvmTarget = "11" - } } repositories { diff --git a/packages/android-player/android/build.gradle b/packages/android-player/android/build.gradle index 1a7834f..daa86b6 100644 --- a/packages/android-player/android/build.gradle +++ b/packages/android-player/android/build.gradle @@ -48,9 +48,6 @@ android { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } - kotlinOptions { - jvmTarget = "11" - } } repositories { diff --git a/packages/google/android/build.gradle b/packages/google/android/build.gradle index da2fa5b..76737de 100644 --- a/packages/google/android/build.gradle +++ b/packages/google/android/build.gradle @@ -48,9 +48,6 @@ android { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } - kotlinOptions { - jvmTarget = "11" - } } repositories { diff --git a/packages/huawei/android/build.gradle b/packages/huawei/android/build.gradle index c5be276..1f7ffb1 100644 --- a/packages/huawei/android/build.gradle +++ b/packages/huawei/android/build.gradle @@ -50,9 +50,6 @@ android { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } - kotlinOptions { - jvmTarget = "11" - } } repositories {