Android Marshmallow - calling a library module (native library) from another library module

I have 3 modules in my application with the name (for example) "application" , "emp-library" , "face-library" .

application - contains only the loading screen and opens the library activity emp-library .

emp-library . This is a library module and contains the basic form of the employee and the camera module to get the image of the employee, and the image will be transferred to the face-library . > for face detection.

face-library . This is a library module and contains a face recognition library for face detection (own library - own face detection algorithm).

The app works on Lollipop devices . But when I run the application in Marshmallow , it becomes broken with the exception below.

Fatal signal 11 (SIGSEGV), code 2, fault addr 0xdeadbaad in tid 32696

Note. This is the only error message I received in the logs.

Is there any specific library build required for Marshmallow devices ? Please help me solve this problem?

Updated:

-> Since I can not find any technical error (as far as I know, I did not get any exception in my own code), I followed the trial and error method.

- > face-library app ( ). NOT CRASHED.

- > , face-library emp-library ". .

- Marshmallow (face-library) ( emp-library)?

+4
1

, marshmallow. armeabi-v7 armeabi, armV8, 64 .

-, armv8.

, (, ) .

, , , https://codelabs.developers.google.com/codelabs/android-studio-jni/index.html?index=..%2F..%2Findex#0

Logger, c printf.

logger.h

#ifndef LOGGER_H
#define LOGGER_H

#include <strings.h>
#include <android/log.h>

#define LOG_INFO(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOG_ERROR(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)

#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG,__VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG  , LOG_TAG,__VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO   , LOG_TAG,__VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN   , LOG_TAG,__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR  , LOG_TAG,__VA_ARGS__)

#endif

cpp:

#include "Foo.h"
#include "logger.h" //include your logger.h
#define LOG_TAG "your_Log_tag"

void Foo::myFunction(char * mystring)
{
 LOGV("Hello foo %s",mystring)
}

, . , .

, OpenCV ++ Android, , , .

+6

Source: https://habr.com/ru/post/1655973/


All Articles