简体   繁体   English

Android Studio可以识别一个,但不能识别另一个连接的设备

[英]Android Studio recognizes ONE but NOT another connected device

I started using Android Studio (AS) last week. 我上周开始使用Android Studio(AS)。 I made a working app for my phone. 我为手机制作了一个可运行的应用。 I now want to run it on a tablet. 我现在想在平板电脑上运行它。 AS doesn't see that it's connected. AS没有看到它已连接。 Logcat says "device not found". Logcat说“找不到设备”。

I've done a ton of research to no avail. 我做了很多研究都无济于事。 My question is, "What do I have to do to make AS see my connected device?" 我的问题是, “我该怎么做才能使AS看到连接的设备?”

I'm listing everything that I can imagine is relevant. 我列出了所有我能想到的相关内容。

  • Windows Explorer does see it and Device Manager calls it a "portable device". Windows资源管理器会看到它,并且设备管理器将其称为“便携式设备”。 I asked to update its driver and device mgr tells me I have the latest. 我要求更新其驱动程序,设备mgr告诉我我有最新的。
  • When I connect each device, the top of each device screen says "Connected as a media device" and "USB DDebugging connected." 当我连接每个设备时,每个设备屏幕的顶部显示“已作为媒体设备连接”和“已连接USB DDebugging”。
  • In DOS I did adb devices and the phone does show but not the tablet. 在DOS中,我做了adb devices ,但手机确实显示了,但平板电脑没有显示。
  • Device manager calls BOTH devices "Portable devices" but it ONLY calls the phone an "ADB Interface". 设备管理器将两个设备都称为“便携式设备”,但仅将电话称为“ ADB接口”。

I went to Android Developers Forum to ask about this. 我去了Android开发者论坛问这个问题。 Never been there before. 从来没有去过那里。 Here's what it says: 它说的是:

New here? 新来的? If you're just starting with Android application development and have a beginner-level question, consider asking it on Stack Overflow. 如果您刚刚开始开发Android应用程序,并且有初学者级的问题,请考虑在Stack Overflow上提问。

So here I am, looking for the same kind of help as these SO threads that I followed but didn't help: 因此,我在这里寻找与我遵循但没有帮助的这些SO线程相同的帮助:

Here's AndroidManifest.xml: 这是AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.dov.tablet" >

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        android:targetSdkVersion="17"
        <activity
            android:name=".MyActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Here's gradle.build: 这是gradle.build:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 17
    buildToolsVersion "19.1.0"
    defaultConfig {
        applicationId "com.example.dov.tablet"
        minSdkVersion 17
        targetSdkVersion 17
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
 dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

I've done everything I can think of but the device just can't be recognized. 我已经做了所有我能想到的事情,但设备却无法识别。

Can anybody give me a hint about what to do next? 有人可以给我提示下一步怎么做吗?

Funny thing.... all I had to do was visit another five Google links and I got my own solution. 有趣的是...。我所要做的就是访问另外五个Google链接,我得到了自己的解决方案。

I found it here . 我在这里找到的。

The problem: even though device manager "saw" the device, Windows couldn't find drivers to make the tablet (a Verizon Ellipsis) become a phone . 问题是:即使设备管理器“看到”了设备,Windows也找不到驱动程序来使平板电脑 (Verizon Ellipsis)成为手机

The drivers are hidden on the device. 驱动程序隐藏在设备上。

Pull down the top message (notification) bar on the device and look for how it's connected. 下拉设备顶部的消息(通知)栏,然后查找其连接方式。 Click that area and check the "Built-in CD-ROM Drive" box under "Connect as CD-ROM". 单击该区域,然后选中“作为CD-ROM连接”下的“内置CD-ROM驱动器”框。

In Windows Explorer, find that "CD-ROM drive" and run "Install.bat". 在Windows资源管理器中,找到“ CD-ROM驱动器”并运行“ Install.bat”。 It might fail because of unsigned drivers. 由于未签名的驱动程序,它可能会失败。 Click "install anyway" each time you're prompted (maybe four times). 每次出现提示时,请单击“仍然安装”(可能是四次)。 After batch file finishes, check Device Manager for no errors. 批处理文件完成后,检查“ Device Manager是否没有错误。

AS might not be happy yet, saying there is a device but it's off-line. AS可能还不满意,说有设备,但设备已脱机。 Look on the device screen. 在设备屏幕上查看。 It may be asking for confirmation that it's OK to connect. 可能要求确认可以连接。 Accept. 接受。

.................................... ....................................

If that doesn't work: 如果那不起作用:

  1. Shut down 关掉
  2. Hit F8 (or whatever gets to startup options screen on your computer) 按F8键(或进入计算机启动选项屏幕的所有键)
  3. Disable Driver Signature Enforcement. 禁用驱动程序签名强制执行。
  4. Run Install.bat. 运行Install.bat。

....................... .......................

Pull down the devices notifications and CHANGE THE DEVICE FROM BEING A CD-ROM DRIVE back to being a MEDIA DEVICE . 下拉设备通知,将设备从成为CD-ROM驱动器更改为媒体设备

Load Android Studio and run the app. 加载Android Studio并运行该应用程序。

My app worked perfectly. 我的应用程序运行完美。

Hooray. 万岁。

Summary: 摘要: 在此处输入图片说明

ps Before I realized that you have to change the device back to being a media device, logcat was going nuts trying to figure out what to do with it. ps在我意识到必须将设备改回为媒体设备之前,logcat疯了,试图弄清楚该怎么做。

PPS Immediately after the install.bat finished, device manager looked like this: PPS install.bat完成后,设备管理器立即如下所示: 在此处输入图片说明

If your tablet is a samsung one, install Samsung Kies. 如果您的平板电脑是三星的,请安装Samsung Kies。 It solved my problem ... 它解决了我的问题...

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

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