Asked 6 years ago
25 Dec 2017
Views 3332
shabi

shabi posted

react native application run error : run android Build failed with an exception.

i connected device with USB , trying to run app at directly device by


react-native run android 




	FAILURE: Build failed with an exception.

	* What went wrong:
	Execution failed for task ':app:installDebug'.
	> com.android.builder.testing.api.DeviceException: Could not create ADB Bridge.
	ADB location:  
	* Try:
	Run with --stacktrace option to get the stack trace. Run with --info or --debug
	option to get more log output.

	BUILD FAILED



second time i run again
i got following error

com.android.ddmlib.InstallException: Failed to establish session

trying to run at XIAOMI 4 , 6.0.1
iPhone-coder

iPhone-coder
answered Nov 30 '-1 00:00

enable developer mode - In your phone, go to Settings, About phone and click on MIUI version 7 times. You will see a pop up which says you are a developer now.
Go back to Settings, Additional settings, Developer options and enable USB Debugging.
Connect your phone to your PC/Mac and on the phone authorize your computer
go back to Developer options, scroll down to find Turn on MIUI optimization and disable it. Your phone will be rebooted

now try to run it again
Post Answer