title: Android WebRTC - How to fix PeerConnection.createOffer error "CreateOffer called with invalid media streams"?
body: <p>Following <a href="https://tech.appear.in/2015/05/25/Introduction-to-WebRTC-on-Android/" rel="nofollow">this tutorial</a> I have successfully created a GLSurfaceView that displays my local video in my Android app. I am using Pristine's gradle build scripts to use native code for webrtc. The web app works as expected in Chrome.</p>
  
  <p>I have established a connection to my nodejs server via web sockets to join a pre-existing conversation. Kurento is being used to deal with rooms. I believe I need to create an SDP Offer to begin sending and receiving videos between peers at this point. (To begin I simply want the video from the Android device to appear on the web interface.)</p>
  
  <p>However if I create a PeerConnection and add my local media stream (created with PeerConnectionFactory.createLocalMediaStream) and then call createOffer() it fails.</p>
  
  <p>The SDPObserver that listens to my connection gets its onCreateFailure called with the message "CreateOffer called with invalid media streams."</p>
  
  <p>Looking at the C code it appears that the streams do not have unique IDs (despite the fact I have only created one stream).</p>
  
  <p>I've been trying to figure this out for a day now and don't seem to be making any progress. Any suggestions?</p>
  
  <p>Thanks in advance!</p>