I created a new project in Android Studio 0.8 in order to start integrating Android Wear into one of my apps. I create a new project and include the Wear form factor, but when I try to sync I get:
Error:Could not find any version that matches com.google.android.support:wearable:+. Required by: win_control:wear:unspecified
EDIT: I played around with Gradle a bit, and now I get these errors:
Error:Failed to find: com.google.android.gms:play-services-wearable:+ Open in Project Structure dialog
Open FileError:Failed to find: com.google.android.support:wearable:+ Open in Project Structure dialog
Open File
Had the same problem. Open up your Android SDK manager, go to tools -> manage add on sites, and add your own repo:
https://dl-ssl.google.com/android/repository/addon-play-services-5.xml
I finally found these helpful guides. There are lots of broken links and bad info floating around, but these should work:
http://developer.android.com/preview/google-play-services-wear.html
then,
http://developer.android.com/training/wearables/apps/creating.html
Also, double check your android sdk manager to make sure you have all the latest updates, as well as the android support repository/libraries!
All the suggestion here at SO are now outdated.
What you should do is make sure "Google Repository" is checked and installed in the SDK manager.
If all of these didn't work for you, check out the instructions at https://code.google.com/p/android/issues/detail?id=72454 For me, I was simply missing Google Repository from the extras section in the sdk manager
If the SDK manager doesn't find any updates for you, it helped for me to wipe the m2repository folder under ~/.android/extras/google/
.
You can manually add the update site by using your favorite text editor on ~/.android/repositories.cfg
, it should look like this:
### User Sources for Android SDK Manager
#Wed Jul 02 10:15:39 EDT 2014
count=1
src00=https\://dl-ssl.google.com/android/repository/addon-play-services-5.xml
I found out that, as of Android Studio 0.8.1, the option "Manage Add-On Sites" is absent from the Tools menu. Just in case someone else can't find it either, here's how to get to it :
1/ Go to Tools > Android > SDK Manager.
2/ Then, once the SDK Manager is opened, in the top menu go to Tools > Manage Add-On Sites.
There you go, then you just apply what nickjm said (thanks for the tip btw, I was wondering what was going on with this error message !).
Adding the add on site did not work for me. In the android SDK, I simply opened up: Tools->Options...->Enable Preview Tools (Check it) Then it had an update for the wear stuff ... which I, of course, updated.
This allowed the library to be referenced by the IDE.
来源:https://stackoverflow.com/questions/24441321/android-wear-project-gradle-sync-fails