Android ExampleApp has still some c-ares dependencies (after SDK-4666)
bug
**Describe the bug**
I've already described one c-ares leftover (from the ["SDK-4666.Remove c-ares related code and building scripts"](https://github.com/meganz/sdk/commit/5a6a8fcf8cc5a36ea1e82134db5667f34bdb3041) commit) in https://github.com/meganz/sdk/issues/2740, however there's another one.
In `<sdk>/examples/android/ExampleApp/app/src/main/jni/curl/Android.mk` c-ares is still there and causes the following error upon executing `build.sh all`:
```
Android NDK: ERROR:/home/myuser/src/mega_sdk/examples/android/ExampleApp/app/src/main/jni/curl/Android.mk:ares: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /home/myuser/src/mega_sdk/examples/android/ExampleApp/app/src/main/jni/curl/ares/ares-android-x86/lib/libcares.a exists or that its path is correct
/home/myuser/Android/Sdk/ndk/29.0.13113456/build/core/prebuilt-library.mk:51: *** Android NDK: Aborting . Stop.
```
Currently `curl/Android.mk` looks like this:
```
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := curl
LOCAL_SRC_FILES := $(LOCAL_PATH)/curl/curl-android-$(TARGET_ARCH_ABI)/lib/libcurl.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/curl/curl-android-$(TARGET_ARCH_ABI)/include
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
LOCAL_STATIC_LIBRARIES := ares ssl crypto
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := ares
LOCAL_SRC_FILES := $(LOCAL_PATH)/ares/ares-android-$(TARGET_ARCH_ABI)/lib/libcares.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ares/ares-android-$(TARGET_ARCH_ABI)/include
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
LOCAL_STATIC_LIBRARIES := crypto ssl
include $(PREBUILT_STATIC_LIBRARY)
```
And it should be this:
```
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := curl
LOCAL_SRC_FILES := $(LOCAL_PATH)/curl/curl-android-$(TARGET_ARCH_ABI)/lib/libcurl.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/curl/curl-android-$(TARGET_ARCH_ABI)/include
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
LOCAL_STATIC_LIBRARIES := ssl crypto
include $(PREBUILT_STATIC_LIBRARY)
```
**To Reproduce**
Steps to reproduce the behavior:
1. Checkout sdk repo.
2. Change current working directory to `<sdk>/examples/android/ExampleApp/app/src/main/jni`.
3. Run `build.sh all`
**Expected behavior**
Build succeeds.
**Screenshots**
I don't think this is necessary, since the bug/issue (and a potential fix) is well described. And it's trivially reproducible.
**Environment:**
- SDK Version: v9.16.1
- OS: Ubuntu 22.04.5 LTS
- Device: Android
**Additional context**
No additional context.
0 条评论