3

Had to do a full (re) install of Android-Studio, to get to the newest 0.8.1 yesterday.

I also did the latest series of updates, via SDK-Manager, using admin privs, which brought me up to 'android-L'.

So now, when I build either a new or pre-existing project, the build goes ok, but when I try to run the newly built projects, they never get installed (on my Nexus-7 tablet, now running 4.4.4, is connected to my laptop via USB-cable).

Instead, I get two lines in RED, the first line containing the pkg: info and the 2nd line always reads:

"Failure [INSTALL_FAILED_OLDER_SDK]"


It appears that there is a newer layout for a build.gradle file.

For my new project, it shows as:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'android-L'
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "org.lazydevs.vtl_sched_webkit"
        minSdkVersion 15
        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'])
}
David
  • 2,253
  • 5
  • 23
  • 29

1 Answers1

0

This is NOT an actual 'answer' to my (own) question yet. But, I have finally gained significant insight into this issue, as well as similar/related posts from others having similar problems with this new 'Beta' kitting of 0.8.0-series of Android-Studio.

First of all, my original symptom was that 'adb' was not installing the app, but was instead giving: "Failure [INSTALL_FAILED_OLDER_SDK]".

My symptom has morphed a bit since then...I do NOT get that symptom anymore. One significant difference now, is no doubt, because after reading numerous others similar issues, numerous people are advising to stay away from using 'android-L' as a target, i.e. to treat that as a separate 'special-case' to be solved LATER, so I followed that advice, and have tweaked my build.gradle to use '19' for both 'targetSdkVersion' and for 'compileSdkVersion'.

The symptom I now encounter is that when I use the IDE (Android-Studio) to do a 'Clean Project' followed by a 'Rebuild Project', and I get no errors.

But, the builds always seem to run so fast that I got suspicious... thinking they can NOT do a whole compile and build and generate an APK file that fast.

Sure enough...once I started doing a cd to top of my project's directory via a Windows cmdline cmd, and then do 'dir /s *.apk', I do NOT find any .APK file!

So, today, I almost could not believe what I started seeing: that, if I do NOT plug-in the USB-cable between this laptop (this is using Windows-7, 64-bit), then the 'Rebuild Project' completes in about 3 seconds and does NOT produce any APK.

But, if i first DO hook up the USB-cable, the build still doesn't produce an APK, but once I use the Run... choice, and choose this new-looking 'app->' choice, THEN FINALLY the Android-Studio 'gets the msg' and dutifully does a long-duration build that DOES produce the APK file.

In all prior versions of Android-Studio I've used, doing a 'Rebuild Project' always produced the .APK file.

Now, it doesn't. Is this a bug or some (obscure) feature?

Ok, so what sort of distinction(s) am I missing! (???)

YIKES!

Can someone please enlighten those of us that are still struggling with this new beast?

To be clear, this isn't a serious/showstopper issue, since the 'workaround' to force an APK file to be produced is to first choose to 'Run' your build. [ Note: I later learned that hooking up the USB-cable is not really the gating item...that just requesting either the 'Run' or 'Debug' dialogs (e.g. to choose an emulator or an 'adb-controlled device) will also trigger the IDE to finally produce the APK file.]

I also noticed an update to bring Android-Studio up to 0.8.2 and so I applied that, but the behavior is still the same.

This needing to run/debug to produce an APK is very counter-intuitive, so hopefully they will restore the earlier default-behavior, to produce an APK, without the need for each user to manually FORCE an APK to be created.

EDIT: THIS ISSUE finally got fixed, in the August upgrade of Android-Studio, from version 0.8.2 to 0.8.6

Cheers!

David
  • 2,253
  • 5
  • 23
  • 29
  • Ok, I filed an issue report to Google, here: https://code.google.com/p/android/issues/detail?id=73370 Google claims this is the expected new behavior, and tries to explain how to fix the issue, but their instructions so far are way too obscure. I still argue to them that the system needs to create an APK by DEFAULT, just as it did back in 0.6.x of Android-Studio. – David Jul 10 '14 at 02:09