Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package X requires unavailable shared library com.android.future.usb.accessory

For some reason, I am getting the error Package X requires unavailable shared library com.android.future.usb.accessory.

This library is included under the project folder in Project Explorer. [Project Folder] -> Google APIs [Android 2.3.3] -> usb.jar -> com.android.future.usb -> UsbAccessory.class, UsbManager.class.

I am using the Google APIs 2.3.3 (API 10). I need it because I'm connecting it to an Arduino USB Host Shield. I've been debugging on my phone up to this point, but now I need logs and debug info because my program isn't sending data for some reason, and I can't figure out why. The program will at least load and perform certain actions when I connect it to my computer (instead of using the AVD). Using the emulator, nothing loads.

I am using an Android Virtual Device with Android 4.2.2 (API 17).

My manifest includes the following:

    <application android:icon="@drawable/ic_launcher" android:label="@string/app_name">
      <uses library android:name="com.android.future.usb.accessory"></uses-library>
      <activity android:name="ArduinoActivity" android:label="@string/app_name" android:launchMode="singleTask">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <intent-filter>
        <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
      </intent-filter>
      <meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" android:resource="@xml/accessory_filter" />
      </activity>
    </application>

Update: I've changed my API to Android 3.1 (API 12). I've changed the library to android.hardware.usb.accessory (instead of com.android.future.usb.accessory). For some reason, I still get an error from the PackageManager (this time with the new library). I've noticed it's pulling that library name from the manifest. Any thoughts? Still having the same issue!

Solution to Update: I forgot to change <uses-library /> to <uses-feature />. More documentation on Android vs Google APIs for USB & USB Accessories: http://developer.android.com/guide/topics/connectivity/usb/accessory.html

like image 540
BLaZuRE Avatar asked Nov 13 '22 07:11

BLaZuRE


1 Answers

USB Accessory mode does not work on API 2.3.3, only 2.3.4 and above. Read here.

like image 146
TronicZomB Avatar answered Nov 14 '22 21:11

TronicZomB