quiet/org.quietmodem.Quiet

Error:error: typedef redefinition with different types ('__kernel_fd_set' vs 'struct fd_set')

Niteesh opened this issue · 10 comments

Information:Gradle tasks [:app:assembleDebug]
Error:error: typedef redefinition with different types ('__kernel_fd_set' vs 'struct fd_set')
/Users/niteesh/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/select.h
Information:(46, 3) previous definition is here
Error:error: typedef redefinition with different types ('u32_t' (aka 'unsigned int') vs '__socklen_t' (aka 'int'))
/Users/niteesh/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/types.h
Information:(116, 21) previous definition is here
Warning:warning: unused parameter 'env' [-Wunused-parameter]
Warning:warning: unused parameter 'reserved' [-Wunused-parameter]
Warning:warning: unused parameter 'env' [-Wunused-parameter]
Warning:warning: unused parameter 'klass' [-Wunused-parameter]
Warning:warning: unused parameter 'This' [-Wunused-parameter]
Error:Execution failed for task ':quiet:ndkBuild'.

Process 'command '/Users/niteesh/Library/Android/sdk/ndk-bundle/ndk-build'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 3.264 secs
Information:3 errors
Information:5 warnings
Information:See complete output in console

Which architecture and Android OS are you targetting?

windows 7x64, android 5.0.1, API 21 (samsung GT-I9500)

It looks like I'm having the same problem. Here's my system information:

Developing on Ubuntu 16.04.3-x86_64
Targeting Android 4.2.2 API 17 (Samsung GT-N5110, ARMv7)

Thanks!

I seemed to have found a temporary solution. I was using the latest version of NDK (r15c). I downgraded to r14b and now it works fine.

To do that, I downloaded the zip file from here: https://developer.android.com/ndk/downloads/older_releases.html. I unzipped it and renamed the android-ndk-r14b folder to ndk-bundle. I then removed the Android/sdk/ndk-bundle folder and moved the unzipped one to the Android/sdk/.

Wow, great catch.

It's almost certainly related to https://android.googlesource.com/platform/ndk/+/ndk-r15-release/docs/UnifiedHeaders.md

As you can guess, I developed on r14. I'll take a look and see if I can fix this. I suspect most likely I will have to break support for r14 and older

Interesting. I can't try it just now, but maybe it will work with r15 by disabling the unified headers as described in that document.

Any luck here? I tried setting the APP_DEPRECATED_HEADERS := true value in the Application.mk file but this did not seem to work. The feature to disable the unified headers seems not to be exist in r16 (https://android.googlesource.com/platform/ndk/+/master/docs/UnifiedHeaders.md) or available as an option with the gradle plugin. So reverting to r15 or lower is the only option until this is fixed.

To fix this, it looks like you need to update the quiet lwip library if I'm not mistaken? Im not an expert in the native domain but if you can give some guidance id be happy to spend some time and try to fix this and update this project to use the Android N platform and build tools.

I still want to fix this. Sorry for the delay, I know this is a blocker.

Thanks Brian, let me know if there is something I can help with

Hi @Niteesh @beznadega727 @andrescj @mustafasezgin

I believe the new fix I have in will get this particular bug. Can you check if that fixes compilation for you? Sorry for the delay!