Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV Library error with AndroidStudio

I'm having issues with current Android project I'm working on, It has OpenCV Library imported as Module and set as dependency. After updating Android Studio from 0.8.14 to 1.0, and trying to sync Gradle I'm getting following error:

Error:Library projects cannot set applicationId. applicationId is set to 'org.opencv' in default config.

I'd like to post my project structure and grade file, but I can't upload images yet.

like image 988
Darko Smoljo Avatar asked Dec 04 '14 21:12

Darko Smoljo


2 Answers

Try commenting applicationID out of your library module's build.gradle file. Like this:

defaultConfig {
//    applicationId "com.library.package"
    minSdkVersion 14
    targetSdkVersion 21
}

I'm still new at Android Studio, and am by no means an expert, but I got the same error after upgrading and this seems to fix it.

like image 84
Sterling Avatar answered Nov 17 '22 13:11

Sterling


I tried to use comment, but instead to fix it, it generate new error (SOLVED).

With "applicationId 'lecho.lib.hellocharts'" enabled:

Library projects cannot set applicationId. applicationId is set to 'lecho.lib.hellocharts' in default config

With "applicationId 'lecho.lib.hellocharts'" disabled (as comment):

A problem occurred configuring project ':hellocharts-library'. Exception thrown while executing model rule: org.gradle.api.publish.plugins.PublishingPlugin$Rules#addConfiguredPublicationsToProjectPublicationRegistry(org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectPublicationRegistry, org.gradle.api.publish.PublishingExtension, org.gradle.api.internal.project.ProjectIdentifier) java.lang.NullPointerException (no error message)

I found solution.

like image 2
Michal Avatar answered Nov 17 '22 12:11

Michal