Closed easysoft2k15 closed 8 years ago
Thanks for asking and pointing me to the stack overflow question! I missed it because I look for the reactive tags but not android.
I have not done any android dev yet, so having a git repo that contains all the changes and the sample app and the steps to install the android/ xamarin env needed to reproduce would be much easier.
That said, the dll not found problem seems like a xamarin / android issue not an rxcpp issue.
Hi kirkshoop, thank You for the very quick feedback. I agree with You: seems a Android/Xamarin problem to me too. I'll try to setup a java project using Visual Studio 2015 (so You don't will not need to setup Xamarin stuff) and make a repo in order to reproduce the problem. I'll come back to You as soon as everything it's ready (hopefully some time tomorrow). Thank You Alessandro
Sounds good, thanks!
Finally I found some time to prepare the repo: https://github.com/easysoft2k15/AndroidRxCppTest.git My suspicion is that for some reasons when I include the line that crash the application, the size of the .so lib increase over a certain limit and thus Android does not load it anymore. Your thoughts would be highly appreciated. Thank You
cool, I will take a look today.
On the repo I also inserted the error message Android is generating. It mention: .... cannot locate symbol "__tls_get_addr" referenced by "librxcpp.so" Maybe this may help in pointing You in the right direction Alessandro
Yes, this was helpful, Thanks!
I had to run vs2015 setup to get the android support and reflash my tablet before I could test, but all is good now.
I was able to repro and then figure out how to get it working.
The std lib support for tls is excluded on android and iOS. Previously someone contributed pthread support for rxcpp on iOS. The workaround is to add:
#define RXCPP_ON_IOS
before including rx.hpp or to set -DRXCPP_ON_IOS flag on the compiler.
The fix will be a pull request that changes the pthread support to work for android as well as iOS.
Hi Kirk, first of all Thank You very much!! You are a genius! I compiled it with the directive:
as first line as You suggested. If I deploy to the device and then lunch the app from the phone it work! The only problem is when I try to lunch it from Visual Studio with debugger attached (F5). The debugger crash with the message: "The application arm-linux-androideabi-gdb-orig.exe has stopped working." This may be related to the #define RXCPP_ON_IOS directive or due to something else. I'll investigate further. Just out of curiosity are You getting the same behavior? Anyhow again Thank You. If I may help some how to the project (even with translation of documentation in Italian if You need it), I'll be very happy to contribute back somehow. So do not hesitate to ask! Alessandro
Yes, I see the gdb crash when debugging. I am searching for answers, but no response yet.
Thank you for already contributing via this issue and the stack overflow question, I would welcome additional contributions!
I also confirm that adding -DRXCPP_ON_IOS
also fix the undefined reference to '__tls_get_addr'
problem when compiling with Android NDK.
Speaking of which, we can detect Android with #ifdef __ANDROID__
. So, I think we need a permanent fix into the repo?
Yes, I think there should be __ANDROID__
detection and declaring RXCPP_ON_ANDROID
in the same way as RXCPP_ON_IOS
is defined.
Guess I can make a pull-request if needed..
By the way I looked for solutions to the GDB crash problem but I was not able to find anything. If someone find out a way to solve this problem please advise. Thank You
hm... not sure about GDB, but i don't have any problems building with clang and debugging with lldb. GCC in the NDK is deprecated.
Forgot to mention, I run and debug in Android Studio 2.0 Preview 5.
Thank You gchudnov for Your feedback! I'm using VS2015 and it comes with GDB for Android development. I never used lldb but I'll give it a try.
Guess, Visual Studio will switch to Clang for Android projects as GCC in the NDK is deprecated.
Thanks to @gchudnov for the PR #186 - this is now resolved! RXCPP_ON_IOS is not required when compiling for Android.
Not sure if this is the right place to ask this question: I'm trying to compile RxCpp for Android but I'm having difficulties as reported in this StackOverflow post: https://stackoverflow.com/questions/34550833/compile-rxcpp-for-android Do You have some idea of what's going on? Thank You for Your support and Thank You for Reactive (I'm successfully using it on most of my C# project)! Alessandro