Skip to content
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

使用ndk22预编译的curl和openssl 静态库时有崩溃 #12

Open
woshildh opened this issue Jun 27, 2022 · 3 comments
Open

使用ndk22预编译的curl和openssl 静态库时有崩溃 #12

woshildh opened this issue Jun 27, 2022 · 3 comments

Comments

@woshildh
Copy link

woshildh commented Jun 27, 2022

您好,我直接使用release的静态库编译成动态库,再通过jni调用时会在运行.so的方法时崩溃
origin_img_v2_06f0164f-29e9-4a78-875e-63b72e6ef11g
如下是我的 Application.mk 源文件
APP_PLATFORM = android-23 APP_ABI := arm64-v8a armeabi-v7a APP_STL := c++_static APP_CPPFLAGS := -fexceptions -frtti -fvisibility=hidden

如下是我的 Android.mk 源文件
`
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := crypto
LOCAL_SRC_FILES := E:\GateSecuritySDK\Network/third_party/openssl/$(TARGET_ARCH_ABI)/libcrypto.a
LOCAL_EXPORT_CFLAGS := -I$(NDK_PROJECT_PATH)/third_party/openssl/include
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := ssl
LOCAL_SRC_FILES := E:\GateSecuritySDK\Network/third_party/openssl/$(TARGET_ARCH_ABI)/libssl.a
LOCAL_EXPORT_CFLAGS := -I$(NDK_PROJECT_PATH)/third_party/openssl/include
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := curl
LOCAL_SRC_FILES := E:\GateSecuritySDK\Network/third_party/curl/$(TARGET_ARCH_ABI)/libcurl.a
LOCAL_EXPORT_CFLAGS := -I$(NDK_PROJECT_PATH)/third_party/curl/include
include $(PREBUILT_STATIC_LIBRARY)

LOCAL_SRC_FILES :=

include $(CLEAR_VARS)
LOCAL_MODULE := UmeNetwork
LOCAL_SRC_FILES := CommonHttp.cpp CommunicateBuffer.cpp ResponseListener.cpp
LOCAL_STATIC_LIBRARIES := libcurl libssl libcrypto
LOCAL_LDLIBS := -lz
include $(BUILD_SHARED_LIBRARY)
`

@robertying
Copy link
Owner

看 log 似乎和 openssl 没有关系,报错的是 UmeLog.cpp,是 UmeNetwork module 的问题吧?

@woshildh
Copy link
Author

UmeLog.cpp 是我们的崩溃记录,根据我打的日志,崩溃的地方在 curl_global_init(CURL_GLOBAL_DEFAULT); 在这个方法调用前可以正常输出,调用curl_global_init(CURL_GLOBAL_DEFAULT);时崩溃了

看 log 似乎和 openssl 没有关系,报错的是 UmeLog.cpp,是 UmeNetwork module 的问题吧?

@robertying
Copy link
Owner

那光靠截图里的 log,没法知道哪里有问题了。可以修改一下编译脚本,关闭优化,打开 debug 之类的 flag,重新编译,再看看到底是什么问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants