Ask Your Question
0

how do I fix OpenCV importing errors?

asked 2016-09-20 01:11:51 -0600

Aisha gravatar image

updated 2016-09-20 01:34:42 -0600

berak gravatar image

SO no matter what I did I keep on encountering the same errors I am trying to import OpenCV into android studio 2.1.3 and i have followed all the instructions carefully and tried all available solutions and no luck in getting them to vanish

my errors are : 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....\openCVLibrary300\build\outputs\apk\openCVLibrary300-release-unsigned.apk

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-09-20 03:01:14 -0600

alienmon gravatar image

updated 2016-09-20 03:04:38 -0600

This might help.

Let me quote from the answer.

The error appears when you are trying to add a dependency which is an APK using:

apply plugin: 'com.android.application'

tells Gradle to build it as an application, generating an APK using:

apply plugin: 'com.android.library'

it will build as a library, generating an AAR.

Check the link for more detail

edit flag offensive delete link more

Comments

ok it worked but i ended up getting the following error Error:Library projects cannot set applicationId. applicationId is set to 'com.example.sawsanalzoubi.vision' in default config.

do you know anything that could help thank you ..

Aisha gravatar imageAisha ( 2016-09-20 05:04:55 -0600 )edit

Try to delete or comment the applicationId in the defaultConfig

alienmon gravatar imagealienmon ( 2016-09-20 09:46:24 -0600 )edit

did that and it didn't work other ideas??

Aisha gravatar imageAisha ( 2016-09-20 09:57:39 -0600 )edit

Can you copy the error message and your code?

alienmon gravatar imagealienmon ( 2016-09-20 20:09:19 -0600 )edit

Here you go Error:Library projects cannot set applicationId. applicationId is set to 'com.example.sawsanalzoubi' in default config. app/build.gradle apply plugin: 'com.android.library'

android { compileSdkVersion 24 buildToolsVersion "23.0.2"

defaultConfig {
    applicationId 'com.example.sawsanalzoubi'
    minSdkVersion 15
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
buildTypes {
    debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
sourceSets { main { jni.srcDirs = ['src/main/jni', 'src/main/jniLibs/'] } }

}

Aisha gravatar imageAisha ( 2016-09-20 21:50:13 -0600 )edit

dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.2.0' compile project(':openCVLibrary300')

Aisha gravatar imageAisha ( 2016-09-20 21:52:52 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-09-20 01:11:51 -0600

Seen: 948 times

Last updated: Sep 20 '16