Trouble setting up Hello, World watch app in Android Studio - android

When deploying the wear version of the included Hello, World watch app in Android Studio I get this error:
Failure [INSTALL_FAILED_OLDER_SDK]
Update: Removing details about trying a hacked version of L from the Reddit post as that was not a solution for me and it may have created more confusion.
mobile/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.erikbabel.myapplication"
minSdkVersion 15
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.google.android.gms:play-services-wearable:+'
}
wear/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.erikbabel.myapplication"
minSdkVersion 20
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
}
Everything else is untouched from the New Project directions. I'm running on my Moto Ultra 4.4 and the LG G watch.

The error [INSTALL_FAILED_OLDER_SDK] is because I was deploying the wear gradle build to the phone (which has an incompatible api). In order to deploy the wearable gradle build to the LG G watch, you have to enable bluetooth debugging and connect your adb to the watch. Then select the watch in the Choose Device dialog.

OP has solved this issue, noting that a wearable app can be deployed directly to the wearable device for debugging, but not to a phone. The other option is to package the wearable app inside of a handheld app and deploy the handheld app to the phone. This will then cause the wearable app to be deployed to the wearable device paired with the phone. As of writing this, this is the only method to include a wearable app in the Play Store.
When publishing to users, you must package a wearable app inside of a handheld app, because users cannot browse and install apps directly on the wearable. If packaged properly, when users download the handheld app, the system automatically pushes the wearable app to the paired wearable.
Note: This feature doesn't work when you are signing your apps with a debug key when developing. While developing, installing apps with adb install or Android Studio directly to the wearable is required.
Source: https://developer.android.com/training/wearables/apps/packaging.html

Related

Unable to use breakpoints in Android Studio

I just installed the latest version of Android Studio, my computers OS is Windows 10 x64.
The problem is that for some reason Android Studio wont hit the breakpoints.. no matter if I use my nexus 10 with USB-debugging enabled, or if I use a VM.. however.. the app gets "published" to the selected device and launched.
This is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.xxxx.xxxx"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
debuggable true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
}
Any ideas?
I have Unity3D installed on the same machine but there is currently no process thats associated with Unity3D running.. and adb devices do list the connected device(s)..
I have also tried to run adb kill-server and adb start-server.. but that didnt do it either..
Br,
Inx

Android wear handled device offline

I am working since a few days on an app for my wearable device but since yesterday, i see my device offline.
my graddle file looks like that :
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '23.0.0'
defaultConfig {
applicationId "com.example.ile14017.moto360"
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.2.0'
compile 'com.google.android.gms:play-services-wearable:7.5.0'
}
I tried to reset my handled device, that didn't change anything. It could be coming from my sdk tools (wrong version used?).
your gradle - File is not related to your device state. What get's displayed in your IDE is basically the output of the adb (Android Debug Bridge). So the display of your devices in the IDE is the output of adb list devices. You could restart the adb by using
adb kill-server
adb start-server
Also you can use adb list devices to see if your device is mentioned where.
As I am not into wearables I don't know if you got to turn on development options there again. On some systems it's importend that the USB vendor id is known, e.g. Linux (udev).

Why does the Android App that sends data to azure SQL Database not running on phone but on AVD on Android Studio?

I am trying to make an ANDROID APP that sends data from phone to the SQL Database at the Azure Cloud.
I have followed, as close as possible,the tutorials given on
https://azure.microsoft.com/en-us/documentation/articles/mobile-services-dotnet-backend-android-get-started/
First Off All, I have a little bit confusion Regarding creating an .APK file in android studio.
Here, I have assumed my .apk is in \app\build\outputs.
Now, I am trying to run app-debug.apk on my REDMI 1s Android Version 4.3 JLS36C, the app simply opens and Vanishes away. I Also tried to run it on Samsung Galaxy Note-3 Neo (SM-N750) Android Version:Android 4.4.2
When I try to run the app on the emulator itself, it is running. But not on Phones. What to do? Here is my build.gradle File
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.zumoappname"
minSdkVersion 8
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
flatDir {
dirs 'aars'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.3'
compile 'com.google.guava:guava:18.0'
compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.2'
compile (group: 'com.microsoft.azure', name: 'azure-notifications-handler', version: '1.0.1', ext: 'jar')
}
Please Help!
Try setting breakpoints in the onCreate method and step through the code so you can find out where the code is failing.
Another issue I have run into is device failures when a network connection is not actually available.
But definitely try to find out what line of code is failing...

Android Studio doesn't read Samsung Galaxy S5

I installed all the latest SDK tools Android SDK Tools 24.3.3 and Android SDK Platform-tools 22,and unfortunaly android studio doesn't like my Samsung S5 Galaxy. It reads it as offline. You can see the picture.
I tried the adb commands kill-server and start-server but with no result. I also turned off and on the USB Debugging from the Developer Options..
This is my gradle file code just in case I did something wrong there. I have another device connected to my mac which is recongised and is online.
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "app.victory.walking.thewalkingviktory"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), '
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.mcxiaoke.volley:library:1.0.15'
compile 'com.ganyo:gcm-server:1.0.2'
compile 'com.google.android.gms:play-services:7.5.0'
}
What could be wrong?
Just Switch Off your Phone, wait for few seconds and then again switch ON and then connect.
Install Samsung Kies then see if it is detecting or not.
See if debugging option is on or not in your phone.

Failure [INSTALL_FAILED_OLDER_SDK] when installing Android Wear sample app

I followed the instructions at this link to create a simple mobile/wearable app in Android Studio. However, upon trying to run it I am getting the error "Failure [INSTALL_FAILED_OLDER_SDK]". My problem seems to be like the one asked at this link, however unlike that user the reddit post that is linked to didn't contain any information that helped me (it basically suggested to add < uses-sdk tools:node="replace" /> to the android manifest, but android studio didn't like the tools thing." My build.gradle files are exactly the same as those at the above link. I just updated Android Studio today (0.8.2) and have installed all necessary SDK's. Many people are getting this error but mine is unique in that I'm targeting the Wear stuff and not concerned with Android L. Any input is appreciated. Thanks!
I believe I have the answer here. Basically instead of deploying to the phone like the instructions say to, you have to enable bluetooth debugging and deploy directly to the watch.
Do those changes in build.gradle file in the wear module
compileSdkVersion 20
targetSdkVersion 20
So the final wear/build.gradle content will be:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "your package name"
minSdkVersion 20
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
}

Categories

Resources