Darko Smoljo
Darko Smoljo

Reputation: 435

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.

Upvotes: 14

Views: 4938

Answers (2)

Michal
Michal

Reputation: 2201

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.

Upvotes: 2

Sterling
Sterling

Reputation: 6635

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.

Upvotes: 24

Related Questions