Search code examples
androiddebuggingmobileflash-builderadb

Flash Builder 4.7 shows Samsung Pro Tab 8.2 as offline when it's actually online


This sort of thing has already been asked about a couple of times before, but the advice I've seen hasn't fixed my problem. I'm starting to work on an AIR Mobile project in Flash Builder 4.7 (it was 4.6 yesterday), and it doesn't want to debug directly on a Samsung Galaxy Pro Tab 8.2 my boss has handed me. When I try to run the application, written in AS3, it just keeps showing the device as offline.

It's been recommended to:

  • update USB drivers - done
  • update adb.exe to 1.0.31 - done
  • check "USB debugging" on the device - done
  • run "adb devices", then accept the RSA signature thing - done

What else is there?

EDIT

Something to note is that there doesn't seem to be a "charge-only" mode on the device; at least some versions of KitKat stripped out a couple of the options for the USB mode.

Also I've tried previously to download the following files from Android and to update my Flex SDK with them:

  • aapt.exe
  • adb.exe
  • AdbWinApi.dll
  • AdbWinUsbApi.dll
  • dx.jar

Unfortunately I couldn't get that to work earlier. When I saw it posted about previously, somebody said that the "right versions" of those files would all be within a single, specific folder within an Android SDK folder - <Android root>\android-sdk\platform-tools - but I only had three of them in that folder; so within the Android downloads, I had to hunt around a little and pull them from different spots.

For example, I would pull aapt.exe from <Android root>\android-sdk\build-tools\21.1.2, and I would pull dx.jar from <Android root>\android-sdk\build-tools\21.1.2\lib.

Maybe that means the versions I copied over weren't correct? I've tried using the Android SDK Manager to get them, but it doesn't seem to want to get them all and put them in the same spot and/or get all the right files in the first place. If somebody could show me a repository for the right versions, or at least a way to make sure I'm downloading the right versions, I can try it again to see if that might end up being the answer.

Also if I go into the command prompt as an administrator and navigate to the folder adb is in for Flash Builder, and if I run adb from there, this is what I get:

>adb devices
adb server is out of date.  killing...
* daemon started successfully *
List of devices attached
0e5d4a10064eb62c        device

However this is a problem that's widely attributed to HTC, which my computer doesn't have anything to do with.


Solution

  • Jan led me to the problem by making me look closer at the situation with those files.


    TL;DR

    If you're using Flash Builder 4.7, paste the files on that list to <Flash Builder root>\eclipse\plugins\com.adobe.flash.compiler_4.7.0.349722\AIRSDK\lib\android\bin.

    If you're using Flash Builder 4.6, paste them into <Flash Builder root>\sdks\4.6.0\lib\android\bin.


    Elsewhere on the Internet, it had been said to paste those files into <Flash Builder root>\sdks\4.6.0\lib\android\bin, but it turns out there was another Flash Builder folder with adb.exe in it, <Flash Builder root>\eclipse\plugins\com.adobe.flash.compiler_4.7.0.349722\AIRSDK\lib\android\bin. Also whereas I seem to remember the first folder's original contents containing a partially different list of files, the second folder's original contents had exactly the same list of files - just older versions of them.

    That being said, after I originally posted this answer, the advice I found on the Internet about putting them in the first folder turned out to be quite true if and only if you're using Flash Builder 4.6; I updgraded to Flash Builder 4.7 while in the process of trying to fix this problem, and my guess is that I didn't try that particular bit of advice out until after I had upgraded. This would have caused that advice to fail, as it's at least somewhat specific to 4.6.

    As for 4.7 though, essentially I was getting that "server out of date" error when I would try to run adb on the command line, and the usual ADB fixer download (adbfix.exe) actually didn't help very much, but information on the Internet described the "server out of date" issue as being a problem with HTC (whatever that is) coming with its own adb in its own folder that is effectively out of sync with whichever adb you're really trying to use. This would cause a sort of runtime conflict between the two. However I didn't have HTC or a folder by that name, so after Jan nudged me back in the right direction, I finally just ran a search for adb.exe in my Flash Builder root directory, and that's when I found the second folder.

    So essentially, having already copied and pasted updated versions of all the files on that list into the first folder (I still got them from three different folders within the Android SDK Manager's directory), I pasted them once more into the second folder. With both folders containing relatively current versions, and having also done other steps like allowing USB debugging on the device and allowing RSA signatures from my desktop or whatever, it was finally able to work, and I was able to debug the AIR Mobile program directly on the device.

    I'm a little curious as to whether even more recent versions of those files tend to break this, or whether you can use any version that's been made for a target of at least 4.4.2. In the end, my adb version is 1.0.32, not 1.0.31, but I did at least try to come close to something that was tailored toward the Android 4.4.2 KitKat.

    Earlier I was also unsure of whether these files had to be pasted into both folders, but now I know that they don't. As far as I know, in FB 4.7's case, pasting them into both folders doesn't hurt anything, as I was able to debug on the device with them having been pasted into both. After originally posting this answer though, I reinstalled 4.7 and just pasted those files into the second folder, but not the first one, and it was still able to work just fine. Finally I reinstalled 4.6 as well, but even an equivalent to the second folder didn't seem to be in its installation folder; only the first folder did, so I just pasted the files into there, and that managed to work as well.

    So essentially, get updated versions of these files:

    • aapt.exe
    • adb.exe
    • AdbWinApi.dll
    • AdbWinUsbApi.dll
    • dx.jar

    from Android SDK Manager (namely, make sure they're compatible with Android 4.4.2), and paste them into the proper SDK folder, which depends on which version of Flash Builder you're using:

    4.7: <Flash Builder root>\eclipse\plugins\com.adobe.flash.compiler_4.7.0.349722\AIRSDK\
         lib\android\bin
    
    4.6: <Flash Builder root>\sdks\4.6.0\lib\android\bin
    

    And of course, if you're using a slightly different minor version of the Eclipse plugin in FB 4.7's case, you might have to change the path slightly to match the version number.