1. Error reporting:
The error of Android C + + OpenSSL link is as follows:
I:/webrtc/android/openssl-1.1.1k/output-armeabi-v7a/lib/libcrypto.a(armcap.o):armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to 'sigfillset'
I:/webrtc/android/openssl-1.1.1k/output-armeabi-v7a/lib/libcrypto.a(armcap.o):armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to 'sigdelset'
I:/webrtc/android/openssl-1.1.1k/output-armeabi-v7a/lib/libcrypto.a(armcap.o):armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to 'sigdelset'
I:/webrtc/android/openssl-1.1.1k/output-armeabi-v7a/lib/libcrypto.a(armcap.o):armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to 'sigdelset'
I:/webrtc/android/openssl-1.1.1k/output-armeabi-v7a/lib/libcrypto.a(armcap.o):armcap.c:function OPENSSL_cpuid_setup: error: undefined reference to 'sigdelset'
I:/webrtc/android/openssl-1.1.1k/output-armeabi-v7a/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function open_console: error: undefined reference to 'tcgetattr'
I:/webrtc/android/openssl-1.1.1k/output-armeabi-v7a/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'signal'
I:/webrtc/android/openssl-1.1.1k/output-armeabi-v7a/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'tcsetattr'
I:/webrtc/android/openssl-1.1.1k/output-armeabi-v7a/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'tcsetattr'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
2. Reason:
Sigdelset, sigfillset and signal cannot be found in the SDK of Android
3. Solution:
Modify the minSdkVersion of build.grandle to a version number after 21:
apply plugin: 'com.android.application'
def LIBWEBRTC_HOME_PATH = "I:/webrtc/android/webrtc_m84_20201001/webrtc_android/src/"
//def LIBWEBRTC_HOME_PATH = "I:/webrtc/android/androidnativeapi/app/webrtc/"
android {
compileSdkVersion 28
defaultConfig {
applicationId "org.webrtc.examples.androidnativeapi"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
arguments "-DLIBWEBRTC_HOME_PATH=" + LIBWEBRTC_HOME_PATH,
"-DANDROID_STL=c++_static"
}
}
ndk {
abiFilters "armeabi-v7a"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
// 1. configure the root directory libs to load third-party so libraries, (it is best not to create jniLibs, in the many open source libraries may cause conflicts, not yet found)
// 2. automatically copy the so libraries in the libs directory to the specified directory when running
// 3. If you don't need to recompile the so you created, you can copy the so generated by (app/build/intermediates/transforms) to this directory
jniLibs.srcDirs = ['libs']
// If it is a single folder, you can directly configure it as follows
// jniLibs.srcDir 'libs'
}
}
buildToolsVersion '28.0.2'//ADD
}
repositories {
flatDir{
dirs'libs'
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.aar"])
//implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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(name: 'libwebrtc', ext: 'aar')
//implementation 'org.webrtc:google-webrtc:1.0.+'
}
Read More:
- [Solved] AndroidStudio Error: checkDebugAarMetadata & CheckAarMetadataWorkAction
- Jjwt error: ERROR 9856 — [nio-8083-exec-2] o.a.c.c. [. [. [. [/]. [dispatch server]
- [Solved] o2o Error: addShopImg error:null / character to be escaped is missing
- The principle and return value of get() function in C language
- [Solved] AndroidStudio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
- Uncaught SyntaxError: Unexpected token o in JSON at position 1 [How to Solve]
- I/O error while reading input message; nested exception is java.io.IOException: Stream closed
- o.s.boot.SpringApplication, Error creating bean with name ‘paymentImpl‘, xml Configuration file error
- Java callback function implementation case
- [Solved] Spring boot Run Error: o.s.b.d.LoggingFailureAnalysisReporter ERROR;
- [Solved] ERROR o.s.s.s.TaskUtils$LoggingErrorHandler – Unexpected error occurred in scheduled task.
- [Solved] O2oa compile error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin
- [Solved] spingboot Error: I/O error on POST request for “9411/api/v2/spans“: connect timed out
- Jmeter Error: ERROR o.a.j.JMeter: Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]
- IDEA Error: ERROR 16720 —[ restartMain] o.a.coyote. http11.Http119Protocol: Failed to sta
- Problems and causes of Java’s main function format (public static void main (string args()))
- Asynchronous callback case of Java callback function
- C++ String case conversion and transform, tower, upper, usage
- C++: Implementation of multi-channel IO transfer with select
- [Solved] port (127.0.0.1:64444): java.net.SocketException “Interrupted function call: accept failed“