简体   繁体   English

Android-Studio升级到0.8.1 - 现在无法使用ADB

[英]Android-Studio upgraded to 0.8.1 - can't use ADB now

Had to do a full (re) install of Android-Studio, to get to the newest 0.8.1 yesterday. 不得不完全(重新)安装Android-Studio,以获得昨天最新的0.8.1。

I also did the latest series of updates, via SDK-Manager, using admin privs, which brought me up to 'android-L'. 我还通过SDK-Manager使用admin privs进行了最新的一系列更新,这使我达到了'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). 所以现在,当我构建一个新的或预先存在的项目时,构建就可以了,但是当我尝试运行新构建的项目时,它们永远不会被安装(在我的Nexus-7平板电脑上,现在运行4.4.4,是通过USB电缆连接到我的笔记本电脑)。

Instead, I get two lines in RED, the first line containing the pkg: info and the 2nd line always reads: 相反,我在RED中得到两行,第一行包含pkg:info,第二行总是读取:

"Failure [INSTALL_FAILED_OLDER_SDK]" “失败[INSTALL_FAILED_OLDER_SDK]”


It appears that there is a newer layout for a build.gradle file. 看来build.gradle文件有一个更新的布局。

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'])
}

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. 但是,我终于获得了对这个问题的重要见解,以及来自其他人的类似/相关帖子,这些帖子与0.8.0系列Android-Studio的新“Beta”套装有类似的问题。

First of all, my original symptom was that 'adb' was not installing the app, but was instead giving: "Failure [INSTALL_FAILED_OLDER_SDK]". 首先,我的原始症状是“adb”没有安装应用程序,而是提供:“失败[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, ie 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'. 现在一个显着的差异,毫无疑问,因为在阅读了许多其他类似问题之后,许多人建议远离使用'android-L'作为目标,即将其作为一个单独的'特殊情况'来解决稍后,我遵循了这个建议,并调整了我的build.gradle,为'targetSdkVersion'和'compileSdkVersion'使用'19'。

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. 我现在遇到的症状是,当我使用IDE(Android-Studio)执行“清理项目”后跟“重建项目”时,我没有得到任何错误。

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. 但是,构建似乎总是运行得如此之快以至于我怀疑......认为他们无法完成整个编译和构建并快速生成一个APK文件。

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! 果然......一旦我开始通过Windows cmdline cmd在我的项目目录中创建一个CD,然后执行'dir / s * .apk',我找不到任何.APK文件!

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. 所以,今天,我几乎无法相信我开始看到的:如果我不插入这台笔记本电脑之间的USB电缆(这是使用Windows-7,64位),那么'重建项目'完成在大约3秒内,不会产生任何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. 但是,如果我第一次连接USB电缆,构建仍然不会产生APK,但是一旦我使用Run ...选项,并选择这个新的'app->'选项,那么最后Android-Studio'获取了msg'并尽职尽责地进行了长时间构建,以生成APK文件。

In all prior versions of Android-Studio I've used, doing a 'Rebuild Project' always produced the .APK file. 在我使用的所有Android-Studio的早期版本中,执行“重建项目”总是生成.APK文件。

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. 要明确的是,这不是一个严重的/ showstopper问题,因为强制生成APK文件的“解决方法”是首先选择“运行”您的构建。 [ 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 (eg to choose an emulator or an 'adb-controlled device) will also trigger the IDE to finally produce the APK file.] [注意:我后来才知道连接USB电缆并不是真正的门控项目......只需要“运行”或“调试”对话框(例如选择模拟器或“adb控制的设备”)还会触发IDE最终生成APK文件。]

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. 我还注意到将Android-Studio升级到0.8.2的更新,所以我应用了它,但行为仍然是相同的。

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. 这需要运行/调试以生成APK是非常违反直觉的,所以希望他们将恢复早期的默认行为,以生成APK,而无需每个用户手动强制创建APK。

EDIT: THIS ISSUE finally got fixed, in the August upgrade of Android-Studio, from version 0.8.2 to 0.8.6 编辑:这个问题最终得到修复,在8月份的Android-Studio升级版中,从0.8.2升级到0.8.6

Cheers! 干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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