react-native-audio-streaming
react-native-audio-streaming copied to clipboard
undefined is not an object (evaluating 'ReactNativeAudioStreaming.getStatus')
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 :)
Full code to reproduce this is available at https://github.com/dmbstream/mobile
Hi ! Could you please post also the exception ?
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)
Weird, did you try the manual installation process ? https://github.com/tlenclos/react-native-audio-streaming#3-manual-installation
I think It has to do with the JavaScript version
@jgeurts try this react-native link react-native-audio-streaming
and then react-native run-android
@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.
@jgeurts That worked for me in Android, Check this link for iOS. Linking Libraries - iOS
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?
same problem: BUILD SUCCEEDED in console but : undefined is not an object (evaluating '_reactNativeAudioStreaming.ReactNativeAudioStreaming.play')
use the manual way (3rd option) to solve this
@zerbfra Nothing changed. Still getting the same error. Tried all ways of installation
any updates on this? i'm getting the same error
I´m having the same issue on Android "react-native": "0.45.1",
The example project works. What else is different in the setup? (I'm having trouble with android)
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.
@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.
Hi, the same thing for me, someone solved this ?
Same issue
@tb9jen you saved me :) Dragging ReactNativeAudioStreaming.xcodeproj inside project did the trick. Thanks!
Tried all installation types and I still get same error fatal error: 'React/RCTBridgeModule.h' file not found #import <React/RCTBridgeModule.h>
I have the same issue ../native/React/Base/RCTBridgeModule.h:54:16: Redefinition of 'RCTMethodInfo'
@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"