-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapty NativeModule is not defined #132
Comments
Hi @yuhr, thank you for the report! We're working on making expo auto-linking work! Could you try disabling the expo auto-linking for now? |
Having the same issue on Android
Disabling auto linking with the following did not fix the problem react-native.config.js module.exports = {
dependencies: {
'react-native-adapty': {
platforms: {
android: null,
},
},
},
} The app builds but the following error is thrown when the app loads Hope this gets resolved soon |
@vladd-g |
@vladd-g Iam using this versions but still getting same error: |
@MuhammedYesilyurt @moe12572 Could you please try a clean and prebuild? |
@vladd-g I'm using Expo Go on iOS (iPhone only). Still getting the same issue: Package.json... |
@vladd-g @moe12572 I just clean the project then I rebuild the project by expo so its working successfully now but iam getting error on another process; const placementId = 'xx-placement'; [2024-11-30T18:01:50.995Z] [[email protected]] "fetch/get_paywall": Calling bridge function: OK {"error": [Error: {"type":"AdaptyError","data":{"adapty_code":2006,"message":"Response decoding failed","detail":"HTTPError.decoding(GET /sdk/in-apps/public_live_1Qb3CUdj/paywall/variations/xx-placement/caf8b348824cb3c376826a993faa8a39/, [3.0.3]: Adapty/HTTPRequestWithDecodableResponse.swift#61, statusCode: 200, dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "data", intValue: nil), _CodingKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "attributes", intValue: nil), CodingKeys(stringValue: "paywall_builder", intValue: nil), ContainerCodingKeys(stringValue: "paywall_builder_config", intValue: nil), CodingKeys(stringValue: "assets", intValue: nil), _CodingKey(stringValue: "Index 113", intValue: 113), CodingKeys(stringValue: "value", intValue: nil)], debugDescription: "Encountered Data is not valid Base64.", underlyingError: nil)))"}}]} |
What commands are you running @MuhammedYesilyurt @vladd-g ? I ran expo start -c and rm -rf node_modules and yarn install |
i just remove ios folder with node modules then run only yarn install packagename, then for build; |
@vladd-g do you have any suggestion for this issue? |
@MuhammedYesilyurt this appears to be related to the specific paywall, not the SDK itself, please feel free to reach out to [email protected] |
Hello, the app is working fine for me when i run yarn run v1.22.21
$ /Users/expo/workingdir/build/node_modules/.bin/expo export:embed --eager --platform ios --dev false
Starting Metro Bundler
iOS Bundled 7723ms node_modules/expo-router/entry.js (1185 modules)
Exporting server
λ Bundled 3688ms node_modules/expo-router/build/static/getServerManifest.js (905 modules)
Metro error: Adapty NativeModule is not defined
Error: Adapty NativeModule is not defined
at new NativeRequestHandler (/Users/expo/workingdir/build/node_modules/react-native-adapty/dist/native-request-handler/native-request-handler.js:14:19)
at factory (/Users/expo/workingdir/build/node_modules/react-native-adapty/dist/bridge.js:21:19)
at loadModuleImplementation (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:277:5)
at guardedLoadModule (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:184:12)
at require (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:92:7)
at factory (/Users/expo/workingdir/build/node_modules/react-native-adapty/dist/adapty-handler.js:6:18)
at loadModuleImplementation (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:277:5)
at guardedLoadModule (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:184:12)
at require (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:92:7)
at /Users/expo/workingdir/build/node_modules/react-native-adapty/dist/index.js:5:26
Adapty NativeModule is not defined
Error: Adapty NativeModule is not defined
Error: Adapty NativeModule is not defined
at new NativeRequestHandler (/Users/expo/workingdir/build/node_modules/react-native-adapty/dist/native-request-handler/native-request-handler.js:14:19)
at factory (/Users/expo/workingdir/build/node_modules/react-native-adapty/dist/bridge.js:21:19)
at loadModuleImplementation (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:277:5)
at guardedLoadModule (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:184:12)
at require (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:92:7)
at factory (/Users/expo/workingdir/build/node_modules/react-native-adapty/dist/adapty-handler.js:6:18)
at loadModuleImplementation (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:277:5)
at guardedLoadModule (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:184:12)
at require (/Users/expo/workingdir/build/node_modules/metro-runtime/src/polyfills/require.js:92:7)
at /Users/expo/workingdir/build/node_modules/react-native-adapty/dist/index.js:5:26
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. |
Hello @johannbuscail Does this algorithm not work for you? |
@vladd-g No, only when doing |
@johannbuscail could you please share what eas version you use, and its json configuration? |
Yes, eas-cli/13.4.2
darwin-arm64
node-v22.9.0
expo-v0.21.8 And eas.json: {
"cli": {
"version": ">= 12.5.2",
"appVersionSource": "remote"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"ios": {
"enterpriseProvisioning": "universal"
}
},
"preview": {
"distribution": "internal",
"ios": {
"enterpriseProvisioning": "universal"
}
},
"production": {
"autoIncrement": true
}
},
"submit": {
"production": {}
}
} app.json {
"expo": {
"name": "",
"slug": "",
"version": "1.0.0",
"scheme": "",
"newArchEnabled": true,
"web": {
"bundler": "metro",
"output": "server",
"favicon": "./assets/favicon.png"
},
"plugins": [
[
"expo-font",
{
"fonts": [
"node_modules/@expo-google-fonts/inter/Inter_400Regular.ttf",
"node_modules/@expo-google-fonts/inter/Inter_500Medium.ttf"
]
}
],
[
"expo-build-properties",
{
"ios": {
"swiftVersion": "5.0"
},
"android": {
"extraMavenRepos": [
"../../node_modules/react-native-adapty/lib/android/localMaven",
"../../node_modules/@adapty/react-native-ui/android/localMaven"
]
}
}
],
"expo-build-properties"
],
"experiments": {
"typedRoutes": true,
"tsconfigPaths": true
},
"assetBundlePatterns": [
"**/*"
],
}
} |
@johannbuscail thank you! You can remove the Could you please share your metro.config.js as well? |
Yes, metro.config.js: // Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
const { withNativeWind } = require('nativewind/metro');
/** @type {import('expo/metro-config').MetroConfig} */
// eslint-disable-next-line no-undef
const config = getDefaultConfig(__dirname);
config.resolver.unstable_enablePackageExports = true;
config.resolver.unstable_conditionNames = ['browser', 'require', 'react-native'];
module.exports = withNativeWind(config, { input: './global.css' }); |
@johannbuscail thank you! Does it happen with dev EAS builds too? |
Yes, absolutely |
Description
I'm experiencing this while migrating our bare React Native 0.73.4 project to Expo 52 CNG setup. The installation guide doesn't help as we're not using EAS Build yet; we want to stick to
expo run:*
for now to avoid wasting the free quota of build count.Could someone provide any clue about what might cause this error?
Few notes:
react-native-adapty
2.11.3 is outdated, but upgrading to 3.0.1 didn't solve the issue.Version
v2.11.3
What platforms are you seeing the problem on?
Android
System info
The text was updated successfully, but these errors were encountered: