react-native-disable-battery-optimizations-android icon indicating copy to clipboard operation
react-native-disable-battery-optimizations-android copied to clipboard

null is not an object (evaluating '_reactNativeDisableBatteryOptimizationsAndroid.default.enableBackgroundServicesDialogue')

Open emersonrf227 opened this issue 4 years ago • 1 comments

Fiz a inclusão da biblioteca onde apresentou o seguinte erro null is not an object (evaluating '_reactNativeDisableBatteryOptimizationsAndroid.default.enableBackgroundServicesDialogue')

` componentDidMount() { RNDisableBatteryOptimizationsAndroid.enableBackgroundServicesDialogue(); this.getData(); Audio.setAudioModeAsync({ allowsRecordingIOS: false, interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX, playsInSilentModeIOS: true, interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX, shouldDuckAndroid: true, staysActiveInBackground: true, playThroughEarpieceAndroid: false, playsInBackgroundModeIOS: true, playsInBackgroundModeAndroid: true

	});

	this.consultaMusica();
	this._interval = setInterval(() => {
		this.consultaMusica()

	}, 5000);
}`

emersonrf227 avatar Apr 24 '20 23:04 emersonrf227

You need to rebuild the application
npx react-native start to run the metro bundler
npx react-native run-android to rebuild the android application (and start it on the phone)

bl4val avatar Jun 21 '20 14:06 bl4val