0

I have an application using the hidden nfc_extras API on Android 4.4.

I do not use the Java Reflection, meaning I re-package the com.android.nfc_extras.jar file and use it in Eclipse as a referenced library.

My application starts two different activities depending on the choice (button) done from the MainActivity layout. This means I also need the android-support-v4.jar library (it was automatically included in my libs folder by Eclipse). It needs to be signed before being installed.

If on Build Path->Configure Build Path -> Order And Export, the com.android.nfc_extras.jar file is clicked, then when I want to do Export -> Export Android Application, I get the following error:

[Dex Loader] Unable to execute dex: Multiple dex files define Lcom/android/nfc_extras/EeIOException;

If the com.android.nfc_extras.jar file is not clicked, the export/signing is OK but at execution, I have the following errors (among others):

W/dalvikvm( 1015): VFY: unable to find class referenced in signature (Lcom/android/nfc_extras/NfcAdapterExtras;)
...
E/AndroidRuntime( 1015): java.lang.NoClassDefFoundError: com.android.nfc_extras.NfcAdapterExtras

I have another application that only makes use of the com.android.nfc_extras.jar library and not the android-support-v4.jar one, so I am wondering if the problem comes from that.

ADTC
  • 8,999
  • 5
  • 68
  • 93
Alex
  • 73
  • 1
  • 8
  • You should look at [THIS](http://stackoverflow.com/a/10046725/1289716) answer – MAC Jan 13 '14 at 08:55
  • I tried and added the com.android.nfc_extras.jar in my libs folder. I removed it as a Referenced Library. – Alex Jan 13 '14 at 09:11
  • But I still get the W/dalvikvm( 932): VFY: unable to resolve static method 21: Lcom/android/nfc_extras/NfcAdapterExtras;.get (Landroid/nfc/NfcAdapter;)Lcom/android/nfc_extras/NfcAdapterExtras; and 01-02 00:01:54.937 E/AndroidRuntime( 932): java.lang.NoClassDefFoundError: com.android.nfc_extras.NfcAdapterExtras errors. – Alex Jan 13 '14 at 09:12
  • I also tried to click the Android Private Libraries in Build Path -> Order and Export, but in this case I get the [2014-01-13 15:26:33 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/android/nfc_extras/EeIOException; – Alex Jan 13 '14 at 14:26

1 Answers1

0

I eventually found the answer to my issue. Nothing to do with libraries, I simply missed the

<uses-library android:name="com.android.nfc_extras" android:required="true" />

in my Manifest...

Jared Burrows
  • 54,294
  • 25
  • 151
  • 185
Alex
  • 73
  • 1
  • 8