gustavogenovese/curl-android-ios

File size

Closed this issue · 1 comments

Thanks for the project. I have managed to run the script successfully, however, the output file size (libcurl.a) is almost 5mb, is there anyway to make it alot smaller. I just needed http/https protocol access. I have also tried disabling other protocols in ./configure section but still doesn't help. Any help will be greatly appreciated. Thanks

Well, the generated libcurl.a file is quite big indeed, the mips64 version is around 13MB. However, when you use it in your app the size is smaller. I'm not sure how, but I think only a part of the library is embedded in the final APK or AAR, maybe the unused/unreached functions of the library are stripped. In the sample Android project, if you generate the APK file, you'll see it's only about 6MB and it contains the library for all the architectures (arm, x86, mips, etc). If you open the APK as a ZIP file you'll notice the native library (libtestlibrary.so), that has libcurl.a static-linked, is smaller than libcurl.a