maxs15 / react-native-spinkit

A collection of animated loading indicators for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invariant Violation: Native Component component for "RNSpinkit" does not exist

johnanisere opened this issue · comments

When i tried to use this module I get this Error "Invariant Violation: Native Component component for "RNSpinkit" does not exist"

Here is my code:

import React from 'react';
import { View,Text,TouchableOpacity} from 'react-native';
import styles,{colors} from './styles/style'
import Spinner  from 'react-native-spinkit'


export default class App extends React.Component {

  render() {
    return (
      <View style={styles.container}>
        <View>
          <Spinner isVisible={true} size={100} type='Wave' color='white'/>
        </View>
      </View>
    );
  }
}

the same issue

commented

me too

It wont work for expo project.

commented

@johnanisere "react-antive link" is not finish, and you can jump to these links ios, or android,and I have found whole ios's directory。
If this problem is still exists, you can @ me.
9a229631-dc7a-44d2-be6d-92d422645413
62a2a57c-8fb0-4519-a9b7-dbf1d14c8056

same issue here

In your project's folder:

  1. react-native link react-native-spinkit
  2. cd android & gradlew clean
  3. cd .. and react-native run-ios/android
    Problem solved!

Same here. Any updates or official response on this?

commented

Same here, for both android and iOS, anybody can help ?

For iOS, from your project's root directory:

cd ios/
pod install

cd your project folder
react-native link react-native-spinkit
reopen your IDE & run

doesn't it working on Expo ???

@johnanisere "react-antive link" is not finish, and you can jump to these links ios, or android,and I have found whole ios's directory。
If this problem is still exists, you can @ me.
9a229631-dc7a-44d2-be6d-92d422645413
62a2a57c-8fb0-4519-a9b7-dbf1d14c8056

(issue in Android)
Thank you. I checked my MainApplication.java file and don't found import com.react.rnspinkit.RNSpinkitPackage; and new RNSpinkitPackage().
It works after I append it.

  1. react-native link react-native-spinkit
  2. pod install

Has anyone found a solution for this? There is no RNSpinkit.xcodeproj in my Xcode, I am working with version 10.1. All the other suggestions like react-native link, my rnspinkit is already linked. Where is it supposedly looking for it that it cannot find it?

Its in my MainApplication.java, its in my Loading.js file, its in my package.json file, its in my package-lock.json file, its in my ios/appName.xcodeproj/project.pbxproj file, its in my settings.gradle file and its in my build.gradle file, so where else is it supposed to be that it does not find RNSpinkit?

I am working with React Native 0.53.3 and React 16.2

I have tried everything I have found online short of upgrading react native and I started down that road but it would delete all my AppCenter/ directory.

I try to link the package but i get this error:
Package react-native-spinkit has been ignored because it contains invalid configuration. Reason: "commands" must be an array

Using:
react-native 0.60.4

Doesn't seems to work if using Expo.

It may be occuring because one of two reasons,

First, may be package isn't linked correctly. For that,

react-native link should fix it.

Secondly, even if it is linked correctly then the package needs to be imported inside MainApplication.java file. For that,

Add a import at top of file,

import com.react.rnspinkit.RNSpinkitPackage;

and then inside getPackages() method add new RNSpinkitPackage(),

Problem should be fixed.

@rafaelcavalcante it won't work with expo. It uses native modules.

@rafaelcavalcante it won't work with expo. It uses native modules.

We kinda solved this issue. But thanks for the reply, afrozopsy :)

@rafaelcavalcante it won't work with expo. It uses native modules.

We kinda solved this issue. But thanks for the reply, afrozopsy :)

Hi, you solved it? It works with expo? thank you

@rafaelcavalcante it won't work with expo. It uses native modules.

We kinda solved this issue. But thanks for the reply, afrozopsy :)

Can you describe the solution please ?

I am also seeing this issue with react-native@0.61.5 and react-native-spinkit@1.5.0

In your project's folder:

  1. react-native link react-native-spinkit
  2. cd android & gradlew clean
  3. cd .. and react-native run-ios/android
    Problem solved!

if terminal says "command not found: gradlew" run ./gradlew clean

It does not work for android. IOS has been compiled successfully tho.
I tried to link this lib manually but app keeps crashing on android.

RN: 0.63.2

@rafaelcavalcante it won't work with expo. It uses native modules.

We kinda solved this issue. But thanks for the reply, afrozopsy :)

Hi, you solved it? It works with expo? thank you

It seems Expo doesn't handle this Library