billthefarmer / mididriver

Android midi driver using Sonivox EAS library
176 stars 52 forks source link

crash on unity android 7.0 #23

Closed baioug closed 7 years ago

baioug commented 7 years ago

when i use this in unity for play midi on android 7.0 it will be crash; i soved this by add some depended .so file from android 6.0 image

billthefarmer commented 7 years ago

I know nothing of Unity. If you build the driver from the latest sources using Gradle, or use the .aar file from https://github.com/billthefarmer/mididriver/releases/tag/v1.11, or from https://jitpack.io/#billthefarmer/mididriver/v1.11, the dependencies are resolved.

baioug commented 7 years ago
libHandler = dlopen("libsonivox.so", RTLD_LAZY);
if (!libHandler)
{
    char logStr[512]= {0};
    sprintf(logStr,"dlopen error___________%s",dlerror());
    LOG_E(LOG_TAG, "dlopen libsonivox.so failed");
    LOG_E(LOG_TAG, logStr);
    env->ThrowNew(linkageErrorClass, "dlopen libsonivox.so failed");
    return -1;
}

this is the fail code when i using this lib in unity dlopen can not find libsonivox so i add libsonivox.so in unity then i tell me can not find some other so file so i add all the lib it need; but if i use this lib in my android studio using java code system.loadlibrary() it work just fine i also an noob in unity i add this issues so if someone meet the same problem in any case; sorry for my Chinese English

baioug commented 7 years ago

at the first time i do not know unity can export android studio project so i can only add lib in unity project then i find unity can export an android studio project in this case,i can also using java code to loadlibrary