- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试集成第三方 SDK (DeepAR)。但是当我构建它时,它会显示一个错误。我试图修复它。如果我创建一个简单的新项目,它就可以正常工作。但是我现有的应用程序我使用相机和 ndk。请帮我找出错误。
这是 Cmakelist 文件。
# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html
# Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.4.1)
# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK.
add_library( # Sets the name of the library.
native-lib
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
src/main/cpp/native-lib.cpp)
# Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build.
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log)
# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.
target_link_libraries( # Specifies the target library.
native-lib
# Links the target library to the log library
# included in the NDK.
${log-lib})
Activity 课
public class DeeparActivity extends AppCompatActivity implements AREventListener {
private CameraGrabber cameraGrabber;
private int defaultCameraDevice = Camera.CameraInfo.CAMERA_FACING_FRONT;
private int cameraDevice = defaultCameraDevice;
private DeepAR deepAR;
private int currentMask = 0;
private int currentEffect = 0;
private int currentFilter = 0;
private int screenOrientation;
ArrayList<String> masks;
ArrayList<String> effects;
ArrayList<String> filters;
private int activeFilterType = 0;
private boolean recording = false;
private boolean currentSwitchRecording = false;
private String recordingPath = Environment.getExternalStorageDirectory() + File.separator + "video.mp4";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_deepar);
deepAR = new DeepAR(this);
deepAR.setLicenseKey("foobarbaz");
deepAR.initialize(this, this);
setupCamera();
}
private void setupCamera() {
cameraGrabber = new CameraGrabber(cameraDevice);
screenOrientation = getScreenOrientation();
switch (screenOrientation) {
case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:
cameraGrabber.setScreenOrientation(90);
break;
case ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE:
cameraGrabber.setScreenOrientation(270);
break;
default:
cameraGrabber.setScreenOrientation(0);
break;
}
// Available 1080p, 720p and 480p resolutions
cameraGrabber.setResolutionPreset(CameraResolutionPreset.P1280x720);
final Activity context = this;
cameraGrabber.initCamera(new CameraGrabberListener() {
@Override
public void onCameraInitialized() {
cameraGrabber.setFrameReceiver(deepAR);
cameraGrabber.startPreview();
}
@Override
public void onCameraError(String errorMsg) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle("Camera error");
builder.setMessage(errorMsg);
builder.setCancelable(true);
builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.cancel();
}
});
AlertDialog dialog = builder.create();
dialog.show();
}
});
}
}
下面给出了确切的错误
2020-11-20 00:17:37.274 7565-7728/com.songsterbd.songster E/IJKMEDIA: Option ijkiomanager not found.
2020-11-20 00:17:39.691 7565-7565/com.songsterbd.songster E/sterbd.songste: No implementation found for void ai.deepar.ar.DeepAR.setLicenseKeyN(java.lang.String) (tried Java_ai_deepar_ar_DeepAR_setLicenseKeyN and Java_ai_deepar_ar_DeepAR_setLicenseKeyN__Ljava_lang_String_2)
2020-11-20 00:17:39.692 7565-7565/com.songsterbd.songster E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.songsterbd.songster, PID: 7565
java.lang.UnsatisfiedLinkError: No implementation found for void ai.deepar.ar.DeepAR.setLicenseKeyN(java.lang.String) (tried Java_ai_deepar_ar_DeepAR_setLicenseKeyN and Java_ai_deepar_ar_DeepAR_setLicenseKeyN__Ljava_lang_String_2)
at ai.deepar.ar.DeepAR.setLicenseKeyN(Native Method)
at ai.deepar.ar.DeepAR.setLicenseKey(DeepAR.java:223)
at com.songsterbd.songster.view.activity.DeeparActivity.initializeDeepAR(DeeparActivity.java:363)
at com.songsterbd.songster.view.activity.DeeparActivity.initialize(DeeparActivity.java:105)
at com.songsterbd.songster.view.activity.DeeparActivity.onCreate(DeeparActivity.java:79)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
我试图修复它。如果需要更多信息,请告诉我。我感谢你。谢谢
最佳答案
一周后,我找到了解决方案。它会与图书馆产生冲突。我将 CMakeLists 文件更改为新文件,然后删除冲突。
现在工作的 CMakeList 文件是:
# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html
# Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.4.1)
# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK.
add_library( # Sets the name of the library.
cpp-cla
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
src/main/cpp/cpp-cla.cpp)
# Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build.
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log)
# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.
target_link_libraries( # Specifies the target library.
cpp-cla
# Links the target library to the log library
# included in the NDK.
${log-lib})
关于java.lang.UnsatisfiedLinkError : No implementation found (When Implement a SDK),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64917805/
我经常在 C 标准文档中看到“实现定义”的说法,并且非常将其作为答案。 然后我在 C99 标准中搜索它,并且: ISO/IEC 9899/1999 (C99) 中第 §3.12 条规定: 3.12 I
“依赖于实现”中的“实现”是什么意思? “依赖于实现”和“依赖于机器”之间有什么区别? 我使用C,所以你可以用C解释它。 最佳答案 当 C 标准讨论实现时,它指的是 C 语言的实现。因此,C 的实现就
我刚刚在 Android-studio 中导入了我的项目,并试图在其中创建一个新的 Activity。但我无法在 android-studio 中创建 Activity 。我指的是here我看不到将目
我想知道您对为什么会发生此错误的意见。在陆上生产环境中,我们使用 CDH4。在我们的本地测试环境中,我们只使用 Apache Hadoop v2.2.0。当我运行在 CDH4 上编译的同一个 jar
我正在尝试集成第三方 SDK (DeepAR)。但是当我构建它时,它会显示一个错误。我试图修复它。如果我创建一个简单的新项目,它就可以正常工作。但是我现有的应用程序我使用相机和 ndk。请帮我找出错误
我很好奇为什么我们有 @Overrides 注释,但接口(interface)没有类似的习惯用法(例如 @Implements 或 @Implementation)。这似乎是一个有用的功能,因为您可能
我对 DAODatabase(适用于 Oracle 11 xe)的 CRUD 方法的实现感到困惑。问题是,在通常存储到 Map 集合的情况下,“U”方法(更新)会插入新元素或更新它(像 ID:Abst
Java-API 告诉我特定类实现了哪些接口(interface)。但有两种不同类型的信息,我不太确定这意味着什么。例如,对于“TreeSet”类:https://docs.oracle.com/en
我有一个接口(interface) MLService,它具有与机器学习算法的训练和交叉验证相关的基本方法,我必须添加两个接口(interface)分类和预测,它们将实现 MLService 并包含根
我一直想知道如何最好地为所有实现相同接口(interface)的类系列实现 equals()(并且客户端应该只使用所述接口(interface)并且永远不知道实现类)。 我还没有编写自己的具体示例,但
我有一个接口(interface)及其 2 个或更多实现, public interface IProcessor { default void method1() { //logic
我有同一个应用程序的免费版和高级版(几乎相同的代码,相同的类,到处都是“if”, list 中的不同包, list 中的进程名称相同)。主要 Activity 使用 IMPLICIT Intent 调
这是我为我的应用程序中的错误部分编写的代码 - (id)initWithData:(NSData *)data <-------- options:(NSUInteger)opti
请查找随附的代码片段。我正在使用此代码将文件从 hdfs 下载到我的本地文件系统 - Configuration conf = new Configuration(); FileSys
我想在 MongoDB 中使用 Grails2.5 中的“ElasticSearch”插件。我的“BuildConfig.groovy”文件是: grails.servlet.version = "3
我收到一条错误消息: fatal error: init(coder:) has not been implemented 对于我的自定义 UITableViewCell。该单元格未注册,在 Stor
得到这个错误 kotlin.NotImplementedError: An operation is not implemented: not implemented 我正在实现一个 ImageBut
typedef int Element; typedef struct { Element *stack; int max_size; int top; } Stack; //
Playground 代码 here 例子: interface IFoo { bar: number; foo?: () => void; } abstract class Abst
我想知道如何抑制警告: Category is implementing a method which will also be implemented by its primary class. 我
我是一名优秀的程序员,十分优秀!