Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No component found for view with name "ARTShape"

Tags:

react-native

Just trying to produce an hello-world for using the ART object in React Native, I get the above exception as if part of the library were not linked. I just added the following code:

import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  ART
 } from 'react-native';

...
<Text style={styles.instructions}> Press Cmd+R to reload,{'\n'} Cmd+D or shake for dev menu </Text> <ART.Shape fill={"black"} d={"M10,10 L 30,30"}/> </View> ...

to index.ios.js after react-native init my-app. So what am I doing wrong? Do I have to link some package with rnpm?

react-native-cli: 0.2.0
react-native: 0.27.0

like image 311
Stefano Pugnetti Avatar asked Jun 06 '16 13:06

Stefano Pugnetti


3 Answers

There is no ART.xcodeproject it RN> 0.61. In /ios/Podfile add

pod 'React-ART', :path => '../node_modules/react-native/Libraries/ART'
like image 196
Ajit Aranha Avatar answered Nov 07 '22 23:11

Ajit Aranha


You need to link the ART Library to your iOS project.

Refer to the React Native document,

  1. Find the ART Xcode Project in the node_module/react-native

enter image description here


  1. Drag the ART Project into your project_folder/Libraries

enter image description here


  1. Go the Build Phase tab of YOUR PROJECT, add libART.a into Link Binary into Libraries.

enter image description here

Hope it helps. :)

like image 48
shentaoy Avatar answered Nov 07 '22 22:11

shentaoy


I drag and dropped node_modules/react-native/Libraries/ART/ART.xcodeproj somewhere to my Xcode project. After that I was able to add libART.a under Build Phases -> Link Binary With Libraries

source: https://github.com/bgryszko/react-native-circular-progress/issues/23

like image 5
Akhilesh Sinha Avatar answered Nov 07 '22 23:11

Akhilesh Sinha