2016-09-19 59 views
0
package com.example.sawsanalzoubi.vision; 

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

所以 「進口org.opencv.android.OpenCVLoader」 我有遇到以下錯誤:我想進口的OpenCV到安卓studio2.1.3

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 codethis 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 ,仍然沒有工作

回答

0

所以我最終通過的this person

幫助解決問題,當你試圖將出現錯誤添加一個依賴其是使用APK: 應用插件:「com.android.application」 告訴搖籃到它建立作爲應用程序,使用生成APK:

應用插件:「融爲一體。 android.library' 它將構建爲一個庫,生成一個AAR。 對於更多詳細信息檢查this link

+0

但我結束了另一個錯誤錯誤:庫項目無法設置applicationId。 applicationId在默認配置中設置爲'com.example.sawsanalzoubi.vision'。 –