【问题标题】:I am trying to import openCV into android studio2.1.3我正在尝试将 openCV 导入到 android studio2.1.3
【发布时间】:2016-09-19 21:25:20
【问题描述】:
package com.example.sawsanalzoubi.vision;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

所以在“import org.opencv.android.OpenCVLoader”中我遇到了以下错误:

unused import statement  

import org.opencv.android.OpenCVLoader;
public class MainActivity extends AppCompatActivity {
private static  final String TAG="MainActivity";
static
{
if(!OpenCVLoader.initDebug){Log.d(TAG,"OpenCV not loaded");
}
    else
{
     Log.d(TAG,"OpenCV loaded");
 }
}
static{ System.loadLibrary("opencv_java3"); }
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}
}

this is a picture of the code this is the video that I have followed

现在我的错误出现了:

 1)Error:Dependency Vision:openCVLibrary300:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: C:\Users\...\outputs\apk\openCVLibrary300-release-unsigned.apk

2)Error:Library projects cannot set applicationId. applicationId is set to 'com.example.user.vision' in default config.

我已经尝试了所有我发现的东西 this method 还有这个a solution to a similar question 仍然没有任何效果

【问题讨论】:

    标签: android opencv import module


    【解决方案1】:

    所以我最终在this person的帮助下解决了这个问题

    当您尝试使用以下方式添加作为 APK 的依赖项时会出现错误: 应用插件:'com.android.application' 告诉 Gradle 将其构建为应用程序,使用以下命令生成 APK:

    应用插件:'com.android.library' 它将构建为一个库,生成一个 AAR。 更多详情请查看this link

    【讨论】:

    • 但我最终遇到了另一个错误错误:库项目无法设置 applicationId。 applicationId 在默认配置中设置为“com.example.sawsanalzoubi.vision”。
    猜你喜欢
    • 1970-01-01
    • 2022-11-27
    • 2017-05-18
    • 1970-01-01
    • 1970-01-01
    • 2021-02-14
    • 2020-02-20
    • 1970-01-01
    • 2022-01-11
    相关资源
    最近更新 更多