I recently started learning React-Native and was trying to run a project on Android emulator.However, this was succeeded at the first attempt, but now It doesn't, throwing the following error.
Execution failed for task ':app:installDebug'.
java.io.IOException: Cannot run program "C:\Users\Pavindu\AppData\Local\Android\Sdk\platform-tools\adb.exe": CreateProcess error=740, The requested operation requires elevation
Since this is a well known error message,I could find lot of answers regarding this error.The following were the actions I took according to those answers.But none of those helped me.
cmd /c react-native run-android
node_modules
and npm install
After struggling a lot, here is what I did to overcome the problem.
/Sdk
folder and pasted it in a different location while keeping the old SDK folder there.platform-tools
folder in copied SDK folderplatform-tools
from android site and added it to new SDK folder.ANDROID_HOME
(I use windows)and android/build.properties
file in my react-native project.
sdk.dir="C:\\path\\to\\new\\sdk"
When I run react-native run-android
after these steps,all started working fine.
Note: I know that this seems hacky, but as a help for someone, I decided to write this .