Failure [INSTALL_FAILED_OLDER_SDK] when installing Android Wear sample app - android

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:+'
}

Related

How do you include Android N source code inside Android Studio?

How do you include/download the Android N source code when developing inside Android Studio?
The documentation/source code isn't currently available inside the Android SDK Manager.
#Passer by Thanks for announcement, I managed to download like that :
Source code for Android N is now available from the SDK.
Currently, there is no available documentation and SDK sources code to download from SDK Manager, only compiled SDK and samples (see GitHub). But you can use updated for N API Reference together with Android API Differences Report to figure out the code.
Update: Google pushed Android 7.0 to AOSP so you can now download the sources for API 24 from SDK Manager
To use N preview SDK in project, update your build.gradle as below:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-N'
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.alvenir.myapplication"
minSdkVersion 'N'
targetSdkVersion 'N'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}

how to use marshmallow in Android studio

I am using Android studio and i want to use Marshmallow API and AppCompatActivity. When I created a new project the build.gradle contained the below lines but I receive error at R class which says not a symbol.
Please let me know how to correct the build.gradle to get the App work.
gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.com.myapplication"
minSdkVersion 19
targetSdkVersion 23
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:23.0.1'
}
Click on Build->Clean Project and that will perform a gradle clean
Update your Android SDK Manager Install all component of Android 6.0 (API 23)
R file can be erased due to many reasons, try rebuilding your project(which is the most common issue) and other issues may include any syntax error or inappropriate file permissions in work space, the exact error report can help address the issue better.

package name is not determined in android studio

i am using Android studio 1.5. and at when i click run i receive
unable to determine package name
i checked the manifest file and it is as shown in the image below...but i do not know why the activities are marked with red even the app name and the icon
as well.
please let me know how to fix this
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.com.bt_11"
minSdkVersion 21
targetSdkVersion 23
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:23.0.1'
}
I followed the same steps as user2121 and eventually tried downgrading to Android Studio 1.4.1. Unlike user2121, I still got an error, however it was different than when on 1.5.1.
AndroidManifest.xml file not found
Upon searching for this new error, I found this StackOverflow answer which solved the problem for me on 1.5.1 as well as 1.4.1.

My codes are highlighted in red, but my code works. How can I fix this?

I'm trying to implement Google Maps in my app, I've already requested the API and already properly put in the API key at the right place, and the map seem to load up without any problems, but sections of codes are highlighted in red. Would appreciate any help! Oh, and I am using android studio.
Also, I've tried it on a test app before this, and it worked fine iirc. Then I deleted that project and all the keys at google's developer console and started new for my main project and this happens. If this info helps in any way.
Here's a screenshot of the code error :
Here's build.gradle if it helps :
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "bossharriscorporation.sendmethere"
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.2.0'
compile 'com.google.android.gms:play-services:7.8.0'
}
I found the answer. I was careless. Apparently the application name cannot have an exclamation mark in it. I didn't know before. I shall learn more to better myself.

Failure [INSTALL_FAILED_OLDER_SDK] in Android Studio

So I know that many other people had this problem, but mine is a little different. I've tried running my app on an LG G2 with Android 4.4.4, and a Note 3 with Android 4.4.2, but neither worked. I have installed the API 18, 19, and 20 SDKs.
Failure [INSTALL_FAILED_OLDER_SDK]
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.ween.control"
minSdkVersion 8
targetSdkVersion 'L'
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.android.support:appcompat-v7:19.+'
}
You can't test an Android-L app on a device with lower API.
Take a look here.
You need to make sure your dependencies are configured targeting the same sdk (also make sure the sdk is supported for the dependency).
As of version .11, the gradle plugin now uses the new manifest merger tool by default which you can use to avoid conflicting configurations when merging manifests from your dependencies while building by specifying <uses-sdk tools:node="replace" /> in your AndroidManifest.xml file.
http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger
credit goes to Eddie Ringle
I was having a similar issue but my device sdk was 19 and it was looking for it to be 20. I changed the sdk from the file > Project Structure > SDK to 19 also I noticed when I was running it had the wear value selected in the top toolbar so I switched that to mobile and Voila.

Categories

Resources