cnlohr / rawdrawandroid

Build android apps without any java, entirely in C and Make
MIT License
3.55k stars 226 forks source link

Unable to load native library ... is 64-bit instead of 32 bit #4

Closed dreua closed 4 years ago

dreua commented 4 years ago

I was curios and tried to make this work but I'm struggling to fix this error: 05-12 23:39:27.783 22959 22959 E AndroidRuntime: java.lang.UnsatisfiedLinkError: Unable to load native library "/data/app/org.yourorg.cnfgtest-1/lib/arm/libcnfgtest.so": dlopen failed: "/data/app/org.yourorg.cnfgtest-1/lib/arm/libcnfgtest.so" is 64-bit instead of 32-bit Android displays that App crashed. I tried so far: API 24 (btw: needs change in Manifest to work: remove android:requestLegacyExternalStorage="true") -> Same result

History

First I got this error on make push run:

echo "Installing" org.yourorg.cnfgtest
Installing org.yourorg.cnfgtest
adb install makecapk.apk
adb: failed to install makecapk.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
make: *** [Makefile:128: push] Error 1

I could fix it by setting TARGETS?=makecapk/lib/armeabi-v7a/lib$(APPNAME).so (My uname -a says its armv7l not sure what that means or if that is the correct way of checking my phones ABI though.)

dreua commented 4 years ago

One more thought for tonight: I think adding uninstall to push target (i.e. push : makecapk.apk uninstall) would make sense. (i.e. always uninstall first to avoid installation error in case it is already installed)

cnlohr commented 4 years ago

You should probably be building with this extra flag: https://github.com/cnlohr/rawdrawandroidexample/blob/master/Makefile#L9

cnlohr commented 4 years ago

Looks like it was a bug on my side. Do you mind re-testing @dreua ?

dreua commented 4 years ago

Yes, that fixed it, thank you @Jcd1230 and @cnlohr !

The Demo looks really cool on my Android! I feel some urge to port cnping to Android now...

cnlohr commented 4 years ago

https://github.com/cntools/cnping/issues/19 beckons.

All the stuff to request permissions is already here.