Comments (10)
@burningraven06 If you've not resolved this, we just encountered the same issue and managed to fix it by running
npx react-native link @amplitude/react-native
This issue for us was that the Amplitude SDK wasn't being automatically linked (as it should in RN 0.61+), so whilst this is the 'old' way of doing things it fixed the issue 👍🏼
from amplitude-reactnative.
Can you please provide: React Native version, and Node version? We officially support RN 0.61 and greater. We have documentation in our setup guide for older RN versions that require some configuratio here under troubleshooting.
from amplitude-reactnative.
I'm running React Native version 0.63.3.
When I try
Amplitude.getInstance().init(<API_KEY>)
I get that error.
from amplitude-reactnative.
Have you ran pod install in your app's ios directory and are you on @amplitude/[email protected] (latest)? If not, try deleting the Pods folder and Podfile.lock and run pod install again. Otherwise would you mind sharing more information and provide a code sample including how you are importing the sdk? The SDK works on many 0.63.x projects with zero config auto linking.
from amplitude-reactnative.
We can only provide support if we have the necessary information, at the moment it's impossible to provide suggestions.
from amplitude-reactnative.
I have installed @amplitude/react-native
version "2.0.11", "2.0.9", "2.0.7"
but nothing helped. And I'm working on an android app.
from amplitude-reactnative.
Here's how I'm importing and initializing it
import { Amplitude } from '@amplitude/react-native';
const instance = Amplitude.getInstance();
instance.init(<API_KEY>);
instance.logEvent('SOMETHING TO TEST');
I get that error even after commenting out lines 3 / 4.
from amplitude-reactnative.
@burningraven06 are you using expo?
from amplitude-reactnative.
No, I'm not
from amplitude-reactnative.
@burningraven06 In that case, there is something specific to your project's code that is causing the native bridge to break. This is unrelated to the library, as react-native 0.63.3 and @amplitude/react-native 2.0.11 function properly on Android. I created an example project here that shows this functioning, take a look at the commit history and see if you are missing anything. Other than that we are unable to provide support for code causing issues unrelated to the library.
https://github.com/kelsonpw/Amplitude-RN-0.63.3-Demo
Also take a look at a solution that helped this user's issue with Android: #49 (comment)
Going to close this because it is not library related but happy to still answer questions or help troubleshoot if you continue to post on this issue.
from amplitude-reactnative.
Related Issues (20)
- CLEARTEXT SQLITE DATABASE [M2] [CWE-312] [DAST] - High Vulnerability Report
- Missing Event Properties ! HOT 17
- How to set array of unique values? HOT 6
- 📣 Introducing Amplitude TypeScript SDK for React Native [BETA]
- Migrating from `amplitude-js` to `@amplitude/react-native`: how to find/use these features? HOT 4
- [iOS] Build Failed in Xcode 14 with React Native 0.70.1 HOT 4
- Amplitude.getInstance() generates warnings new NativeEventEmitter() HOT 7
- Support React Native 0.70.x HOT 9
- ERROR: Unhandled promise rejection: TypeError: null is not an object (evaluating 'AmplitudeReactNative.setLibraryName') HOT 3
- Amplitude Logger [Error]: TypeError: Network request failed HOT 2
- The migration from @expo-analytics-amplitude forces us to eject? HOT 2
- [android] App crashing in release mode as soon as we enable proguard HOT 2
- Test Issue ticket creation in AMP
- React native 0.72.0 HOT 7
- Errors found in AndroidManifest.xml HOT 7
- Error: import undefined.AmplitudeReactNativePackage; HOT 1
- A problem occurred configuring project ':amplitude_react-native'. HOT 2
- Cannot read property "prototype" of undefined
- Support for new architecture and bridgeless
- RN 0.73+ The value for property 'languageVersion' is final HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amplitude-reactnative.