developmentseed / libra-live-react-native

A React Native application demoing Libra + AWS Lex integration
3 stars 2 forks source link

WIP android build improvements #6

Closed sethvincent closed 6 years ago

sethvincent commented 6 years ago

I'm able to build the app with these changes, but had to stop for the day at this error:

TypeError: TypeError: undefined is not a function (evaluating '_reactNativeAudio.AudioRecorder.requestAuthorization()')

This error is located at:
    in HomeScreen (at SceneView.js:9)
    in SceneView (at StackViewLayout.js:476)
    in RCTView (at View.js:60)
    in View (at StackViewLayout.js:475)
    in RCTView (at View.js:60)
    in View (at StackViewLayout.js:474)
    in RCTView (at View.js:60)
    in View (at createAnimatedComponent.js:154)
    in AnimatedComponent (at StackViewCard.js:48)
    in Card (at createPointerEventsContainer.js:26)
    in Container (at StackViewLayout.js:506)
    in RCTView (at View.js:60)
    in View (at StackViewLayout.js:399)
    in RCTView (at View.js:60)
    in View (at StackViewLayout.js:398)
    in StackViewLayout (at withOrientation.js:30)
    in withOrientation (at StackView.js:40)
    in RCTView (at View.js:60)
    in View (at Transitioner.js:141)
    in Transitioner (at StackView.js:19)
    in StackView (at createNavigator.js:59)
    in Navigator (at createKeyboardAwareNavigator.js:11)
    in KeyboardAwareNavigator (at createNavigationContainer.js:376)
    in NavigationContainer (at App.js:20)
    in App (at renderApplication.js:33)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:122)
    in AppContainer (at renderApplication.js:32)

This error is located at:
    in NavigationContainer (at App.js:20)
    in App (at renderApplication.js:33)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:122)
    in AppContainer (at renderApplication.js:32)
componentDidMount
    HomeScreen.js:39:4
proxiedComponentDidMount
    createPrototypeProxy.js:61:45
commitLifeCycles
    ReactNativeRenderer-dev.js:10627:12
commitAllLifeCycles
    ReactNativeRenderer-dev.js:12512:10
invokeGuardedCallback
    ReactNativeRenderer-dev.js:39:15
invokeGuardedCallback
    ReactNativeRenderer-dev.js:221:34
commitRoot
    ReactNativeRenderer-dev.js:12677:10
completeRoot
    ReactNativeRenderer-dev.js:13685:46
performWorkOnRoot
    ReactNativeRenderer-dev.js:13635:23
performWork
    ReactNativeRenderer-dev.js:13545:26
performSyncWork
    ReactNativeRenderer-dev.js:13506:16
requestWork
    ReactNativeRenderer-dev.js:13392:6
scheduleWorkImpl
    ReactNativeRenderer-dev.js:13259:24
scheduleWork
    ReactNativeRenderer-dev.js:13207:28
scheduleRootUpdate
    ReactNativeRenderer-dev.js:13930:17
_updateContainerAtExpirationTime
    ReactNativeRenderer-dev.js:13966:6
updateContainer
    ReactNativeRenderer-dev.js:13991:8
render
    ReactNativeRenderer-dev.js:14726:35
renderApplication
    renderApplication.js:49:21
run
    AppRegistry.js:102:10
runApplication
    AppRegistry.js:194:26
__callFunction
    MessageQueue.js:351:47
<unknown>
    MessageQueue.js:116:26
__guardSafe
    MessageQueue.js:314:6
callFunctionReturnFlushedQueue
    MessageQueue.js:115:17

A related issue: https://github.com/jsierles/react-native-audio/issues/280

Frankie34 commented 6 years ago

hi, mate! how did you fix that! I go through the instruction but got a blank screen and nothing.

sethvincent commented 6 years ago

Hey @Frankie34, mostly what I did was go to the android directory, run gradle wrapper, then worked through the issues that came up until I got a successful build. If you're trying to get this app running it might be too soon, it's still under heavy development :smile:.

sethvincent commented 6 years ago

Getting this permission error even though we've got the correct permission in AndroidManifest.xml:

09-12 14:59:26.455  8464  8495 W ReactNativeJS: Error: Make sure you've added RECORD_AUDIO permission to your AndroidManifest.xml file setAudioSource failed.

I made it to this point by following info in this issue: jsierles/react-native-audio#280

markdboyd commented 6 years ago

The permission error was due to the fact that our app did not have permission to use the microphone in the Android emulator:

screenshot_1536866717

If we have time, maybe we should write some code to prompt the user for permission to use the microphone. Or we could put the app in an error state indicating that they need to give permission to use the microphone

Frankie34 commented 6 years ago

very thx! @sethvincent