-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compilation error in android-ndk-r19c #973
Comments
you're building this code for API 21 ( |
after updating minsdk 23 it worked but getting a new error |
nope, that's the error i mentioned in the second sentence of my original reply. that library was built with target API 28, like i said. |
this is my make file
so I have to set API_LEVEL=23 ? |
if you want to run on API level 23, yes, you need to build for API level 23. otherwise the compiler thinks it can use things that weren't available until 24/25/26/27/28, and your code won't run on 23 or earlier. |
@Miteshmakwana73
I want compile a apk that run in a embedded device which have android8.1. like @enh said. the function fread_unlocked supported by api 28 or later. what should i do? ps. i develop with qt for android. and android-ndk-r19c.
best regards. |
What are you using to build? Can you share your build.gradle/cmakelists.txt/android.mk? If you're targeting 28+ and have that problem then something has gone wrong, but we don't have enough information to even guess what it would be. |
@DanAlbert My environment is: Qt13.0 + jdk1.8.0_181 + android-sdk(27,28,29) + android-ndk-r19c. suck as the following picture show. the following files come from my test project. can you point out what's my fault? |
oh, @DanAlbert I found the reason.
I changed the platform in the gui interface of QT. but that not take effect. I changed the android-21 to android-28 manually, and it worked. But unfortunately, the apk cannot run on my device. because my device is android 8.1(api level27). So, if or not i compile a standalone "fread_unlocked" and linked into my project? Thanks |
if you just replace |
@enh regards |
why ndk try to link |
it doesn't. you're using fread_unlocked/fwrite_unlocked somewhere. you can find out where by using objdump on your .o/.so files. |
I had this issue in compiling linux kernel for android 10(api 29).
adding this in Makefile solved it.
|
@amir28 --- can you file a new bug for that? i think that's an unrelated issue that i'm not sure we've checked (if clang is automatically "optimizing" fwrite() to fwrite_unlocked() without paying attention to API level). |
They're compiling a kernel, so AFAIK there shouldn't be an Android API level. sdm630 has been around a while -- is @amir28 using gcc or clang to build it? I think the existence of I'd guess that a header is defining |
The bug originally reported here was user error. If you think you've found a bug, please file a new one (we need the information asked for in the template). Locking to encourage that. |
I am getting this error while running the android studio project, gradle is working okay
full Log error
error.txt
The text was updated successfully, but these errors were encountered: