Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work! #6

Closed
agforte opened this issue Mar 4, 2020 · 2 comments
Closed

Does not work! #6

agforte opened this issue Mar 4, 2020 · 2 comments

Comments

@agforte
Copy link

agforte commented Mar 4, 2020

I have followed the instructions and I always get this error:
ERROR: Failed to resolve: :opencv-debug:3.4.9

This is regardless of the OpenCV version I specify. I have tried with different ones.

I am using:
Android Studio 3.6.1
Gradle 3.6.1

Any help? Thanks.

@ahasbini
Copy link
Owner

ahasbini commented Mar 5, 2020

I've seen this error myself in certain times, its whenever I add the plugin for the first time to a project, or when I change the version to one I didn't have before in any project. Right after that, Android Studio tries to perform a sync and then shows this error. The reason of the error is that the plugin does all the configuration even if Android OpenCV was not downloaded. Most Gradle Plugins work by first setting the configuration and then using the configuration to perform the tasks, but during a sync, Android Studio only takes the configuration without actually running the tasks in the plugin. So the trick is basically to get Android Studio to run the tasks, it's actually done so by building the project.

I was under the assumption that Android Studio does run a build after the sync, but maybe in your case it didn't happen. You can instead run the below command in a shell/cmd which will perform a build. Once completed, you need to perform a sync again in Android Studio to get rid of the error (note the app module your using and change it based on the name of your project):

# Windows
gradlew.bat app:assembleDebug
# *nix
./gradlew app:assembleDebug

In case the problem persists, you could try troubleshooting as per the README and post the logs so we could figure out what went wrong.

@ahasbini
Copy link
Owner

Closing old issues, feel free to comment again or open a new issue(s) if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants