You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I am trying to use the Jfugue on Android, but I am getting this error:
java.lang.NoClassDefFoundError: Failed resolution of: Ljp/kshoji/javax/sound/midi/MidiSystem;
at org.jfugue.player.SequencerManager.getDefaultSequencer(SequencerManager.java:55)
at org.jfugue.player.SequencerManager.<init>(SequencerManager.java:50)
at org.jfugue.player.SequencerManager.getInstance(SequencerManager.java:41)
at org.jfugue.player.ManagedPlayer.<init>(ManagedPlayer.java:47)
at org.jfugue.player.Player.<init>(Player.java:46)
at org.jfugue.midi.MidiFileManager.savePatternToMidi(MidiFileManager.java:53)
at org.jfugue.midi.MidiFileManager.savePatternToMidi(MidiFileManager.java:58)
at com.avister.midiGeneration.GenerateMidiActivity.dubSave(GenerateMidiActivity.kt:52)
at com.avister.ml.models.MusicGeneratorAndroidTest$dubSaveTest$1.perform(MusicGeneratorAndroidTest.kt:141)
at com.avister.ml.models.MusicGeneratorAndroidTest$dubSaveTest$1.perform(MusicGeneratorAndroidTest.kt:18)
at androidx.test.core.app.ActivityScenario.lambda$onActivity$2$ActivityScenario(ActivityScenario.java:660)
at androidx.test.core.app.ActivityScenario$$ExternalSyntheticLambda2.run(Unknown Source:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:2223)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.ClassNotFoundException: Didn't find class "jp.kshoji.javax.sound.midi.MidiSystem" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/android.test.mock.jar", zip file "/system/framework/android.test.base.jar", zip file "/data/app/~~lil1u2Nb8-ocLGw0F8dAbw==/com.avister.test-F5TBrSomZjMeER7Y26_viQ==/base.apk", zip file "/data/app/~~h9pnhGV0TWqabygf7I8F7Q==/com.avister-zQJ2i_8pkzzeqXPzP3hGLg==/base.apk"],nativeLibraryDirectories=[/data/app/~~lil1u2Nb8-ocLGw0F8dAbw==/com.avister.test-F5TBrSomZjMeER7Y26_viQ==/lib/x86, /data/app/~~h9pnhGV0TWqabygf7I8F7Q==/com.avister-zQJ2i_8pkzzeqXPzP3hGLg==/lib/x86, /data/app/~~lil1u2Nb8-ocLGw0F8dAbw==/com.avister.test-F5TBrSomZjMeER7Y26_viQ==/base.apk!/lib/x86, /data/app/~~h9pnhGV0TWqabygf7I8F7Q==/com.avister-zQJ2i_8pkzzeqXPzP3hGLg==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 22 more
When trying to perform this test:
internal class MusicGeneratorAndroidTest {
@get:Rule
val activityTestRule = ActivityScenarioRule(GenerateMidiActivity::class.java)
@Test
fun exampleSaveTest() {
activityTestRule.scenario.onActivity {
it.exampleSave()
}
}
}
class GenerateMidiActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_generate_midi)
}
fun exampleSave() {
val cw = ContextWrapper(applicationContext)
val directory = cw.getExternalFilesDir(Environment.DIRECTORY_MUSIC)
val pattern: Pattern = Pattern("C4")
val file = File(directory, "test.midi")
MidiFileManager.savePatternToMidi(pattern, file)
}
}
What may be the cause and how to fix this?
The text was updated successfully, but these errors were encountered:
Hi! I am trying to use the Jfugue on Android, but I am getting this error:
When trying to perform this test:
What may be the cause and how to fix this?
The text was updated successfully, but these errors were encountered: