简体   繁体   中英

Android Studio - run application on device

I am trying to run the application on my Sony Xperia but it doesn't work. I have followed the steps on http://developer.android.com/tools/device.html

  1. I have enabled USB debugging on my device
  2. I have installed the drivers using the Sony PC Companion (everything well so far as when I try to run it, Android Studio finally recognizes my mobile as a device)
  3. The step I think I am doing wrong is making my application "debuggable" in the build.gradle file

    I have pasted the code in the build.gradle(Module:app)

    android { buildTypes { debug { debuggable true } } }

But when I run it I get the following error:

Unexpected Error Local path doesn't exist. Local path doesn't exist. The project may need to be synced with Gradle files.

Any ideas/tips how I can solve this?

I don't know what OS you have but if you have Windows 7, I would recommend doing the following:

  • Connect your cellphone to your computer
  • Right click on your My Computer and go to Properties then Device Manager
  • Look for your device (It may be under Other Devices or under a separate branch maybe Sony)
  • When you find the device, right click on it and select uninstall
  • In the meantime, you can go to this link and download Universal Windows ADB Driver (This one worked for me) or if you want to use the one you downloaded from SDK Manager, just go to: C:/Users/(Username)/AppData/Local/Android/sdk/extras/google/usb_driver
  • When you finish uninstalling the driver unplug it and plug it back in so the computer can recognize the device.
  • When the computer recognize it, go back into device manager and look for the device that has an yellow exclamation point.
  • Right click on the device with the yellow exclamation point and click Update Driver Software...
  • When the update driver window shows up, click Browse my computer for driver software
  • If you downloaded and installed the Universal ADB, the you must direct the path to C:/Program Files (x86)/ClockworkMod/Universal Adb Driver/usb_driver if not then to the other path which is the one I mentioned above
  • Wait until installation finish then restart the computer (Optional) then give it a try.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM