Skip to content
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

undefined is not an object (evaluating 'ReactNativeAudioStreaming.getStatus') #55

Open
jgeurts opened this issue Dec 19, 2016 · 23 comments
Labels

Comments

@jgeurts
Copy link

jgeurts commented Dec 19, 2016

I'm trying to add the player to the sample app that react creates and am getting an exception when running iOS. I installed react-native-audio-streaming using the cocoapod technique and specified the background audio setting.

My component looks like:

import React, { Component } from 'react';
import {
  StyleSheet,
  Text,
  View
} from 'react-native';
import { Player } from 'react-native-audio-streaming';

export default class App extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>
          Welcome to React Native!
        </Text>
        <Text style={styles.instructions}>
          To get started, edit index.ios.js
        </Text>
        <Text style={styles.instructions}>
          Press Cmd+R to reload,{'\n'}
          Cmd+D or shake for dev menu
        </Text>
        <Player url={"http://lacavewebradio.chickenkiller.com:8000/stream.mp3"} />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

I'm very new to react-native and ios development, so I could very well be missing something trivial :)

@tlenclos tlenclos added the bug label Dec 19, 2016
@jgeurts
Copy link
Author

jgeurts commented Dec 26, 2016

Full code to reproduce this is available at https://github.com/dmbstream/mobile

@tlenclos
Copy link
Owner

Hi ! Could you please post also the exception ?

@jgeurts
Copy link
Author

jgeurts commented Dec 26, 2016

Hopefully this helps - please let me know if I can provide anything else

/Users/jgeurts/dev/meetattheshow_mobile/node_modules/react-native-audio-streaming/ios/ReactNativeAudioStreaming.m:1:9: fatal error: 'RCTBridgeModule.h' file not found
#import "RCTBridgeModule.h"
        ^
1 error generated.



=== BUILD TARGET RCTText OF PROJECT RCTText WITH CONFIGURATION Debug ===

Check dependencies


=== BUILD TARGET RCTSettings OF PROJECT RCTSettings WITH CONFIGURATION Debug ===

Check dependencies

=== BUILD TARGET RCTActionSheet OF PROJECT RCTActionSheet WITH CONFIGURATION Debug ===

Check dependencies

=== BUILD TARGET Pods-MeetAtTheShowTests OF PROJECT Pods WITH CONFIGURATION Debug ===

Check dependencies


** BUILD FAILED **



The following build commands failed:
	CompileC /Users/jgeurts/dev/meetattheshow_mobile/ios/build/Build/Intermediates/Pods.build/Debug-iphonesimulator/RNAudioStreaming.build/Objects-normal/x86_64/ReactNativeAudioStreaming.o /Users/jgeurts/dev/meetattheshow_mobile/node_modules/react-native-audio-streaming/ios/ReactNativeAudioStreaming.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

@tlenclos
Copy link
Owner

Weird, did you try the manual installation process ? https://github.com/tlenclos/react-native-audio-streaming#3-manual-installation

@devvpm
Copy link

devvpm commented Dec 26, 2016

I think It has to do with the JavaScript version

@devvpm
Copy link

devvpm commented Dec 27, 2016

@jgeurts try this react-native link react-native-audio-streaming

and then react-native run-android

@jgeurts
Copy link
Author

jgeurts commented Dec 27, 2016

@devvpm The link command completed successfully, but I'm getting the following now:

** BUILD FAILED **


The following build commands failed:

	CompileC /Users/jgeurts/dev/meetattheshow_mobile/ios/build/Build/Intermediates/Pods.build/Debug-iphonesimulator/RNAudioStreaming.build/Objects-normal/x86_64/ReactNativeAudioStreaming.o /Users/jgeurts/dev/meetattheshow_mobile/node_modules/react-native-audio-streaming/ios/ReactNativeAudioStreaming.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

If it makes a difference, I'm using node v6.6.0. Also, I'm not sure if it matters, but when I modified the Podfile for the iOS project, I linked to node_modules as: pod 'RNAudioStreaming', :path => '../node_modules/react-native-audio-streaming' - Notice the .. before node_modules.

@devvpm
Copy link

devvpm commented Jan 1, 2017

@jgeurts
That worked for me in Android,
Check this link for iOS.
Linking Libraries - iOS

@piloulac
Copy link

piloulac commented Jan 8, 2017

Hi,

i wonder i have a similar issue. Indeed when i try to use ReactNativeAudioStreaming in this case:

> let songsDataSource = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }).cloneWithRows( this.props.artist.songs );
> return(
>                 <ListView
>                     dataSource={ songsDataSource }
>                     style={ styles.songsList }
>                     renderHeader={this.renderHeaderSongList.bind(this)}
>                     renderRow={(song, sectionId, rowId) => (
>                   <TouchableHighlight onPress={ () => {
>                       this.setState({selectedSource: song.url});
>                       {ReactNativeAudioStreaming.play(song.url, {})}
>                   }}>
>                     <View key={song} style={ styles.song }>
>                       <Text style={ styles.songTitle }>
>                         { song.url }
>                       </Text>
>                       <Text style={ styles.albumTitle }>
>                         { song.album }
>                       </Text>
>                     </View>
>                   </TouchableHighlight>
>                  )}
>                 />
>             );
> 

i have the same problem with :
undefined is not an object (evaluating '_reactNativeAudioStreaming.ReactNativeAudioStreaming.play')

I installed it with react native link and i followed all the instructions. Note: The link libraries that i have are: libStreamingKit.a and libPods-ReactNativeAudioStreaming.a (not libReactNativeAudioStreaming.a ). Could it be a problem?

@amirrezamahyari
Copy link

same problem:
BUILD SUCCEEDED in console but :
undefined is not an object (evaluating '_reactNativeAudioStreaming.ReactNativeAudioStreaming.play')

@zerbfra
Copy link

zerbfra commented Jan 14, 2017

use the manual way (3rd option) to solve this

@gaggi4734
Copy link

@zerbfra Nothing changed. Still getting the same error. Tried all ways of installation

@ryanvoong
Copy link

any updates on this? i'm getting the same error

@oximer
Copy link

oximer commented Jun 30, 2017

I´m having the same issue on Android
"react-native": "0.45.1",

@nikolaigeorgie
Copy link

The example project works. What else is different in the setup? (I'm having trouble with android)

@tb9jen
Copy link

tb9jen commented Jul 19, 2017

I used the 2nd method for IOS and got this error too, and it was because I was unable to add lib-ReactNativeAudioStreaming.a ( I only had the option for libPods-ReactNativeAudioStreaming under Link Binary with Libraries) and I found that I needed to add ReactNativeAudioStreaming.xcodeproj under Libraries in order to have the correct option. Once I did that it ran just fine.

@thngdude
Copy link

@tb9jen Hey, this worked for me. So, thanks. I think many folks here are getting stuck up with the libPods-ReactNativeAudioStreaming vs lib-ReactNativeAudioStreaming.

FYI - I used install option #2.

@zaouifahd
Copy link

Hi, the same thing for me, someone solved this ?

@twisstosin
Copy link

Same issue

@polp6880
Copy link

@tb9jen you saved me :) Dragging ReactNativeAudioStreaming.xcodeproj inside project did the trick. Thanks!

@kostyaVyrodov
Copy link

kostyaVyrodov commented Oct 25, 2017

Tried all installation types and I still get same error
fatal error: 'React/RCTBridgeModule.h' file not found #import <React/RCTBridgeModule.h>

@arcesoj
Copy link

arcesoj commented Oct 26, 2017

I have the same issue ../native/React/Base/RCTBridgeModule.h:54:16: Redefinition of 'RCTMethodInfo'

@polp6880
Copy link

@kostyaVyrodov @JoseArceDev - to solve that issue I had to use an older version of React Native. This is what I have in my package.json for the test I did:

"react-native": "0.47.2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests