Git Product home page Git Product logo

Comments (10)

jwbackhouse avatar jwbackhouse commented on August 23, 2024 2

@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.

kelsonpw avatar kelsonpw commented on August 23, 2024

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.

burningraven06 avatar burningraven06 commented on August 23, 2024

I'm running React Native version 0.63.3.

When I try
Amplitude.getInstance().init(<API_KEY>)

I get that error.

from amplitude-reactnative.

kelsonpw avatar kelsonpw commented on August 23, 2024

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.

kelsonpw avatar kelsonpw commented on August 23, 2024

We can only provide support if we have the necessary information, at the moment it's impossible to provide suggestions.

from amplitude-reactnative.

burningraven06 avatar burningraven06 commented on August 23, 2024

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.

burningraven06 avatar burningraven06 commented on August 23, 2024

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.

kelsonpw avatar kelsonpw commented on August 23, 2024

@burningraven06 are you using expo?

from amplitude-reactnative.

burningraven06 avatar burningraven06 commented on August 23, 2024

No, I'm not

from amplitude-reactnative.

kelsonpw avatar kelsonpw commented on August 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.