- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 david-hoze/build-openssl-android: Builds openssl 1.1.0h with android ndk r17. 在我的 Android 项目中包含 OpenSSL .
这是我的设置:安卓工作室 3.2NDK 版本:18.0.5002713
这是我应用的 build.gradle
文件:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
def my_openssl_dir = getRootDir().toString() + "/build-openssl-android/openssl-lib"
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.my-company.my-app"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++17 -frtti -fexceptions"
arguments '-DANDROID_STL=c++_shared'
arguments '-DMY_OPENSSL_DIR=' + my_openssl_dir
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
sourceSets {
main {
jniLibs.srcDirs = [
]
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.2.30'
}
这是我的 CMakeLists.txt
文件:
cmake_minimum_required(VERSION 3.4.1)
include_directories( src/main/cpp/
)
add_library( # Sets the name of the library.
my-library
SHARED
src/main/cpp/my-code.cpp
)
find_library (log-lib log)
add_library(libcrypto STATIC IMPORTED)
set_target_properties(libcrypto PROPERTIES IMPORTED_LOCATION
${MY_OPENSSL_DIR}/${ANDROID_ABI}/libcrypto.a)
add_library(libssl STATIC IMPORTED)
set_target_properties(libssl PROPERTIES IMPORTED_LOCATION
${MY_OPENSSL_DIR}/${ANDROID_ABI}/libssl.a)
target_include_directories(nativ PRIVATE
${MY_OPENSSL_DIR}/${ANDROID_ABI}/include
)
target_link_libraries( # Specifies the target library.
my-library
libcrypto
libssl
${log-lib}
)
我在编译时遇到了这些错误:
Build command failed. Error while executing process /home/david/Android/Sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /home/david/dev/android/MyApplication/app/.externalNativeBuild/cmake/debug/x86_64 --target my-library} [1/1] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/x86_64/libnativ.so FAILED: : && /home/david/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=x86_64-none-linux-android21 --gcc-toolchain=/home/david/Android/Sdk/ndk-bundle/toolchains/x86_64-4.9/prebuilt/linux-x86_64 --sysroot=/home/david/Android/Sdk/ndk-bundle/sysroot -fPIC -isystem /home/david/Android/Sdk/ndk-bundle/sysroot/usr/include/x86_64-linux-android -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -std=c++17 -frtti -fexceptions -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot /home/david/Android/Sdk/ndk-bundle/platforms/android-21/arch-x86_64 -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -L/home/david/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86_64 -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libnativ.so -o ../../../../build/intermediates/cmake/debug/obj/x86_64/libnativ.so CMakeFiles/my-library.dir/src/main/cpp/my-code.cpp.o /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libcrypto.a /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a /home/david/Android/Sdk/ndk-bundle/platforms/android-21/arch-x86_64/usr/lib64/liblog.so -latomic -lm "/home/david/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/x86_64/libc++_shared.so" && : /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_ciph.o):ssl_ciph.c:function do_load_builtin_compressions_ossl_: error: undefined reference to 'COMP_get_type' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_ciph.o):ssl_ciph.c:function do_load_builtin_compressions_ossl_: error: undefined reference to 'COMP_get_name' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_ciph.o):ssl_ciph.c:function ssl_cipher_get_evp: error: undefined reference to 'FIPS_mode' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_ciph.o):ssl_ciph.c:function ssl_cipher_get_evp: error: undefined reference to 'EVP_enc_null' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_ciph.o):ssl_ciph.c:function ssl_create_cipher_list: error: undefined reference to 'FIPS_mode' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_ciph.o):ssl_ciph.c:function ssl_create_cipher_list: error: undefined reference to 'FIPS_mode' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_ciph.o):ssl_ciph.c:function SSL_COMP_add_compression_method: error: undefined reference to 'COMP_get_type' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_ciph.o):ssl_ciph.c:function SSL_COMP_get_name: error: undefined reference to 'COMP_get_name' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_conf.o):ssl_conf.c:function cmd_VerifyCAFile: error: undefined reference to 'X509_STORE_load_locations' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_conf.o):ssl_conf.c:function cmd_ChainCAPath: error: undefined reference to 'X509_STORE_load_locations' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_conf.o):ssl_conf.c:function cmd_ChainCAFile: error: undefined reference to 'X509_STORE_load_locations' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_conf.o):ssl_conf.c:function cmd_VerifyCAPath: error: undefined reference to 'X509_STORE_load_locations' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_read: error: undefined reference to 'ASYNC_WAIT_CTX_new' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_peek: error: undefined reference to 'ASYNC_WAIT_CTX_new' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_write: error: undefined reference to 'ASYNC_WAIT_CTX_new' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_shutdown: error: undefined reference to 'ASYNC_WAIT_CTX_new' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_new: error: undefined reference to 'FIPS_mode' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_clear_cipher_ctx: error: undefined reference to 'COMP_CTX_free' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_clear_cipher_ctx: error: undefined reference to 'COMP_CTX_free' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_default_verify_dir: error: undefined reference to 'X509_LOOKUP_hash_dir' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_default_verify_file: error: undefined reference to 'X509_LOOKUP_file' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_free: error: undefined reference to 'ASYNC_WAIT_CTX_free' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get0_peer_scts: error: undefined reference to 'OCSP_response_get1_basic' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get0_peer_scts: error: undefined reference to 'OCSP_resp_count' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get0_peer_scts: error: undefined reference to 'OCSP_resp_get0' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get0_peer_scts: error: undefined reference to 'OCSP_SINGLERESP_get1_ext_d2i' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_new' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_set1_cert' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_set1_issuer' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_set_time' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_free' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function ssl_validate_ct: error: undefined reference to 'CT_POLICY_EVAL_CTX_free' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_all_async_fds: error: undefined reference to 'ASYNC_WAIT_CTX_get_all_fds' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_changed_async_fds: error: undefined reference to 'ASYNC_WAIT_CTX_get_changed_fds' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_current_compression: error: undefined reference to 'COMP_CTX_get_method' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_get_current_expansion: error: undefined reference to 'COMP_CTX_get_method' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_lib.o):ssl_lib.c:function SSL_CTX_set_default_verify_paths: error: undefined reference to 'X509_STORE_set_default_paths' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_rsa.o):ssl_rsa.c:function SSL_use_certificate_file: error: undefined reference to 'PEM_read_bio_X509' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_rsa.o):ssl_rsa.c:function SSL_use_RSAPrivateKey_file: error: undefined reference to 'PEM_read_bio_RSAPrivateKey' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_rsa.o):ssl_rsa.c:function SSL_CTX_use_certificate_file: error: undefined reference to 'PEM_read_bio_X509' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_rsa.o):ssl_rsa.c:function SSL_CTX_use_RSAPrivateKey_file: error: undefined reference to 'PEM_read_bio_RSAPrivateKey' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_rsa.o):ssl_rsa.c:function SSL_CTX_use_certificate_chain_file: error: undefined reference to 'PEM_read_bio_X509_AUX' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_rsa.o):ssl_rsa.c:function SSL_CTX_use_certificate_chain_file: error: undefined reference to 'PEM_read_bio_X509' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_rsa.o):ssl_rsa.c:function SSL_use_certificate_chain_file: error: undefined reference to 'PEM_read_bio_X509_AUX' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_rsa.o):ssl_rsa.c:function SSL_use_certificate_chain_file: error: undefined reference to 'PEM_read_bio_X509' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(statem_clnt.o):statem_clnt.c:function ssl3_check_cert_and_algorithm: error: undefined reference to 'X509_certificate_type' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(statem_srvr.o):statem_srvr.c:function tls_process_cert_verify: error: undefined reference to 'X509_certificate_type' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(t1_lib.o):t1_lib.c:function ssl_get_auto_dh: error: undefined reference to 'BN_get_rfc3526_prime_3072' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(t1_lib.o):t1_lib.c:function ssl_get_auto_dh: error: undefined reference to 'BN_get_rfc3526_prime_8192' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function SSL_srp_server_param_with_username: error: undefined reference to 'SRP_Calc_B' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function SSL_set_srp_server_param_pw: error: undefined reference to 'SRP_get_default_gN' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function SSL_set_srp_server_param_pw: error: undefined reference to 'SRP_create_verifier_BN' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_server_master_secret: error: undefined reference to 'SRP_Verify_A_mod_N' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_server_master_secret: error: undefined reference to 'SRP_Calc_u' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_server_master_secret: error: undefined reference to 'SRP_Calc_server_key' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_client_master_secret: error: undefined reference to 'SRP_Verify_B_mod_N' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_client_master_secret: error: undefined reference to 'SRP_Calc_u' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_client_master_secret: error: undefined reference to 'SRP_Calc_x' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function srp_generate_client_master_secret: error: undefined reference to 'SRP_Calc_client_key' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function srp_verify_server_param: error: undefined reference to 'SRP_check_known_gN_param' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(tls_srp.o):tls_srp.c:function SRP_Calc_A_param: error: undefined reference to 'SRP_Calc_A' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl3_record.o):ssl3_record.c:function ssl3_do_uncompress: error: undefined reference to 'COMP_expand_block' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl3_record.o):ssl3_record.c:function ssl3_do_compress: error: undefined reference to 'COMP_compress_block' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(s3_enc.o):s3_enc.c:function ssl3_change_cipher_state: error: undefined reference to 'COMP_CTX_free' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(s3_enc.o):s3_enc.c:function ssl3_change_cipher_state: error: undefined reference to 'COMP_CTX_new' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(s3_enc.o):s3_enc.c:function ssl3_change_cipher_state: error: undefined reference to 'COMP_CTX_free' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(s3_enc.o):s3_enc.c:function ssl3_change_cipher_state: error: undefined reference to 'COMP_CTX_new' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_asn1.o):ssl_asn1.c:SSL_SESSION_ASN1_seq_tt: error: undefined reference to 'UINT32_it' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_asn1.o):ssl_asn1.c:SSL_SESSION_ASN1_seq_tt: error: undefined reference to 'INT32_it' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_asn1.o):ssl_asn1.c:SSL_SESSION_ASN1_seq_tt: error: undefined reference to 'ZINT64_it' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_asn1.o):ssl_asn1.c:SSL_SESSION_ASN1_seq_tt: error: undefined reference to 'ZINT64_it' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_asn1.o):ssl_asn1.c:SSL_SESSION_ASN1_seq_tt: error: undefined reference to 'ZINT32_it' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_asn1.o):ssl_asn1.c:SSL_SESSION_ASN1_seq_tt: error: undefined reference to 'ZUINT64_it' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_asn1.o):ssl_asn1.c:SSL_SESSION_ASN1_seq_tt: error: undefined reference to 'ZUINT64_it' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_cert.o):ssl_cert.c:function SSL_add_dir_cert_subjects_to_stack: error: undefined reference to 'OPENSSL_DIR_read' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_cert.o):ssl_cert.c:function SSL_add_dir_cert_subjects_to_stack: error: undefined reference to 'OPENSSL_DIR_end' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(ssl_cert.o):ssl_cert.c:function ssl_build_cert_chain: error: undefined reference to 'X509_verify_cert_error_string' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(t1_enc.o):t1_enc.c:function tls1_change_cipher_state: error: undefined reference to 'COMP_CTX_new' /home/david/dev/android/MyApplication/build-openssl-android/openssl-lib/x86_64/libssl.a(t1_enc.o):t1_enc.c:function tls1_change_cipher_state: error: undefined reference to 'COMP_CTX_new' clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.
非常感谢您的帮助。
最佳答案
问题是链接顺序,我在 CMakelists.txt
文件中更改了 libssl
和 libcrypto
的顺序,如下所示:
cmake_minimum_required(VERSION 3.4.1)
include_directories( src/main/cpp/
)
add_library( # Sets the name of the library.
my-library
SHARED
src/main/cpp/my-code.cpp
)
find_library (log-lib log)
add_library(libcrypto STATIC IMPORTED)
set_target_properties(libcrypto PROPERTIES IMPORTED_LOCATION
${MY_OPENSSL_DIR}/${ANDROID_ABI}/libcrypto.a)
add_library(libssl STATIC IMPORTED)
set_target_properties(libssl PROPERTIES IMPORTED_LOCATION
${MY_OPENSSL_DIR}/${ANDROID_ABI}/libssl.a)
target_include_directories(nativ PRIVATE
${MY_OPENSSL_DIR}/${ANDROID_ABI}/include
)
target_link_libraries( # Specifies the target library.
my-library
libssl
libcrypto
${log-lib}
)
它编译得很好
关于android - 我的应用程序不会在 Android 上使用 OpenSSL 进行链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52663687/
我最近在/ drawable中添加了一些.gifs,以便可以将它们与按钮一起使用。这个工作正常(没有错误)。现在,当我重建/运行我的应用程序时,出现以下错误: Error: Gradle: Execu
Android 中有返回内部存储数据路径的方法吗? 我有 2 部 Android 智能手机(Samsung s2 和 s7 edge),我在其中安装了一个应用程序。我想使用位于这条路径中的 sqlit
这个问题在这里已经有了答案: What's the difference between "?android:" and "@android:" in an android layout xml f
我只想知道 android 开发手机、android 普通手机和 android root 手机之间的实际区别。 我们不能从实体店或除 android marketplace 以外的其他地方购买开发手
自Gradle更新以来,我正在努力使这个项目达到标准。这是一个团队项目,它使用的是android-apt插件。我已经进行了必要的语法更改(编译->实现和apt->注释处理器),但是编译器仍在告诉我存在
我是android和kotlin的新手,所以请原谅要解决的一个非常简单的问题! 我已经使用导航体系结构组件创建了一个基本应用程序,使用了底部的导航栏和三个导航选项。每个导航选项都指向一个专用片段,该片
我目前正在使用 Facebook official SDK for Android . 我现在正在使用高级示例应用程序,但我不知道如何让它获取应用程序墙/流/状态而不是登录的用户。 这可能吗?在那种情
我在下载文件时遇到问题, 我可以在模拟器中下载文件,但无法在手机上使用。我已经定义了上网和写入 SD 卡的权限。 我在服务器上有一个 doc 文件,如果用户单击下载。它下载文件。这在模拟器中工作正常但
这个问题在这里已经有了答案: What is the difference between gravity and layout_gravity in Android? (22 个答案) 关闭 9
任何人都可以告诉我什么是 android 缓存和应用程序缓存,因为当我们谈论缓存清理应用程序时,它的作用是,缓存清理概念是清理应用程序缓存还是像内存管理一样主存储、RAM、缓存是不同的并且据我所知,缓
假设应用程序 Foo 和 Eggs 在同一台 Android 设备上。任一应用程序都可以获取设备上所有应用程序的列表。一个应用程序是否有可能知道另一个应用程序是否已经运行以及运行了多长时间? 最佳答案
我有点困惑,我只看到了从 android 到 pc 或者从 android 到 pc 的例子。我需要制作一个从两部手机 (android) 连接的 android 应用程序进行视频聊天。我在想,我知道
用于使用 Android 以编程方式锁定屏幕。我从 Stackoverflow 之前关于此的问题中得到了一些好主意,并且我做得很好,但是当我运行该代码时,没有异常和错误。而且,屏幕没有锁定。请在这段代
文档说: android:layout_alignParentStart If true, makes the start edge of this view match the start edge
我不知道这两个属性和高度之间的区别。 以一个TextView为例,如果我将它的layout_width设置为wrap_content,并将它的width设置为50 dip,会发生什么情况? 最佳答案
这两个属性有什么关系?如果我有 android:noHistory="true",那么有 android:finishOnTaskLaunch="true" 有什么意义吗? 最佳答案 假设您的应用中有
我是新手,正在尝试理解以下 XML 代码: 查看 developer.android.com 上的文档,它说“starStyle”是 R.attr 中的常量, public static final
在下面的代码中,为什么当我设置时单选按钮的外观会发生变化 android:layout_width="fill_parent" 和 android:width="fill_parent" 我说的是
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 9
假设我有一个函数 fun myFunction(name:String, email:String){},当我调用这个函数时 myFunction('Ali', 'ali@test.com ') 如何
我是一名优秀的程序员,十分优秀!