简体   繁体   中英

Android Studio NDK issue

I have a problem. I have an app which works fine on Android 5 & 6. The app has c++ shared lib refference. The problem is: When I compile and assembling to .apk without selecting my 4.0.3 device as target for execution then after installing it s failing in my native code. But when I s failing in my native code. But when I m trying to address this issue via debug everything works just fine. Is it possible that Android Studio is adding some additional parameters to build configuration without which app wont run. Thank you.

I've found out that the problem is with my lz4 implementation which several years ago I've taken from windows app. There was a lot if stuff like:

#define U32     uint32_t

void* source = {some void pointer}
void* destination = {some void pointer}
*(U32*)destination = *(U32*)source;

I've found on internet implementation of lz4 for Androin and noticed that the differens is in using memcpy not (U32) = (U32). I have rewritten my code to exclude all places like this and it started to work on my 4.0.3.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM