kshoji / USB-MIDI-Driver

USB MIDI Driver for Android 3.1 or later

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adding and using the library as jar devicefilter issue

finndesolace opened this issue · comments

Hi,
I've made a jar file as described in
https://github.com/kshoji/USB-MIDI-Driver/wiki/Extracting-a-jar-package-from-the-library-archive

But Done the first step beneath. But that last one i don't quite get.
There is a classes.jar file. It will be put on the project's lib directory.
I recommend to rename from classes.jar to midi-driver.jar.
There is a res/xml/device_filter.xml file. It will be put on the project's same path.

So when testing it out, i get a no class found def error for jp.kshoji.driver.midi.R$xml
in the device filter
I think it has troble finding the device_filter_xml as you do import jp.kshoji.driver.midi.R where it's part of.

04-24 17:34:26.411: E/AndroidRuntime(2484): FATAL EXCEPTION: main 04-24 17:34:26.411: E/AndroidRuntime(2484): Process: com.example.miditest, PID: 2484 04-24 17:34:26.411: E/AndroidRuntime(2484): java.lang.NoClassDefFoundError: jp.kshoji.driver.midi.R$xml 04-24 17:34:26.411: E/AndroidRuntime(2484): at jp.kshoji.driver.usb.util.DeviceFilter.getDeviceFilters(DeviceFilter.java:65) 04-24 17:34:26.411: E/AndroidRuntime(2484): at jp.kshoji.driver.midi.device.MidiDeviceConnectionWatcher$MidiDeviceConnectionWatchThread.(MidiDeviceConnectionWatcher.java:261) 04-24 17:34:26.411: E/AndroidRuntime(2484): at jp.kshoji.driver.midi.device.MidiDeviceConnectionWatcher.(MidiDeviceConnectionWatcher.java:125) 04-24 17:34:26.411: E/AndroidRuntime(2484): at jp.kshoji.driver.midi.activity.AbstractSingleMidiActivity.onCreate(AbstractSingleMidiActivity.java:129) 04-24 17:34:26.411: E/AndroidRuntime(2484): at com.example.miditest.MainActivity.onCreate(MainActivity.java:40) 04-24 17:34:26.411: E/AndroidRuntime(2484): at android.app.Activity.performCreate(Activity.java:5231) 04-24 17:34:26.411: E/AndroidRuntime(2484): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 04-24 17:34:26.411: E/AndroidRuntime(2484): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169) 04-24 17:34:26.411: E/AndroidRuntime(2484): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2271) 04-24 17:34:26.411: E/AndroidRuntime(2484): at android.app.ActivityThread.access$800(ActivityThread.java:144) 04-24 17:34:26.411: E/AndroidRuntime(2484): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205) 04-24 17:34:26.411: E/AndroidRuntime(2484): at android.os.Handler.dispatchMessage(Handler.java:102) 04-24 17:34:26.411: E/AndroidRuntime(2484): at android.os.Looper.loop(Looper.java:136) 04-24 17:34:26.411: E/AndroidRuntime(2484): at android.app.ActivityThread.main(ActivityThread.java:5146) 04-24 17:34:26.411: E/AndroidRuntime(2484): at java.lang.reflect.Method.invokeNative(Native Method) 04-24 17:34:26.411: E/AndroidRuntime(2484): at java.lang.reflect.Method.invoke(Method.java:515) 04-24 17:34:26.411: E/AndroidRuntime(2484): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732) 04-24 17:34:26.411: E/AndroidRuntime(2484): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566) 04-24 17:34:26.411: E/AndroidRuntime(2484): at dalvik.system.NativeStart.main(Native Method)

Can you help me out? WFR

I changed the min sdk version to 19 (4.4) and target 5.0

Seems like i'm running into this:
http://tools.android.com/recent/buildchangesinrevision14

Because of the comment above i've stated, I downloaded the git and then imported the project.
Then added the javax.sound.midi and annotations.jar and then the project was ready for use with library.