Closed dandingol03 closed 3 months ago
cross compiling from OSX to android is mostly untested. It seems your system picks up the wrong compiler (the OSX one)
try
cmake -DANDROID -DCMAKE_TOOLCHAIN_FILE=..
Hi, thanks for your kindly reply!
After i add -DANDROID=on
, the compiling goes fine. However when i run the NativeActivity
in SampleBrowserNDk, it crashes.
Here is the log:
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.ogre.browser/android.app.NativeActivity}: java.lang.IllegalArgumentException: Unable to find native library OgreSampleBrowser using classloader: dalvik.system.PathClassLoader[DexPathList[[],nativeLibraryDirectories=[/data/app/~~SmkbL73wZwJtfR7wPgLRaA==/org.ogre.browser-6hKon6CpSdD369Odq4eMHQ==/lib/arm64, /system/lib64, /system/system_ext/lib64]]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3846)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4022)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2336)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8653)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: java.lang.IllegalArgumentException: Unable to find native library OgreSampleBrowser using classloader: dalvik.system.PathClassLoader[DexPathList[[],nativeLibraryDirectories=[/data/app/~~SmkbL73wZwJtfR7wPgLRaA==/org.ogre.browser-6hKon6CpSdD369Odq4eMHQ==/lib/arm64, /system/lib64, /system/system_ext/lib64]]]
at android.app.NativeActivity.onCreate(NativeActivity.java:164)
at android.app.Activity.performCreate(Activity.java:8207)
at android.app.Activity.performCreate(Activity.java:8191)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
It seems like that there is no OgreSampleBrowser
lib in the jniLibs.
Here is the command i run on M1 Mac:
check your build log, it should have linked some JNI library like: https://github.com/OGRECave/ogre/actions/runs/8865433793/job/24341676635#step:5:2454
System Information
Detailled description
run
cmake -DCMAKE_TOOLCHAIN_FILE=/Users/wangjunjie05/Downloads/android-sdk-mac/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DANDROID_NDK=/Users/wangjunjie05/Downloads/android-sdk-mac/ndk/21.4.7075529 ..
then error occuredOgre.log