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

[ERROR] Unable to resolve dependency for ':porcupinemanager@debug/compileClasspath': Could not resolve project :porcupine. #60

Closed
wjdgy3746 opened this issue Jul 31, 2018 · 27 comments

Comments

@wjdgy3746
Copy link

wjdgy3746 commented Jul 31, 2018

Expected behavior

I downloaded project .zip file from github, and tried to execute demo/andriod/app in Android Studio.
However, Gradle project sync failed.
Please help me!

Actual behavior

Error messages are below
Unable to resolve dependency for ':porcupinemanager@debug/compileClasspath': Could not resolve project :porcupine.
Unable to resolve dependency for ':porcupinemanager@debugAndroidTest/compileClasspath': Could not resolve project :porcupine.
Unable to resolve dependency for ':porcupinemanager@debugUnitTest/compileClasspath': Could not resolve project :porcupine.
Unable to resolve dependency for ':porcupinemanager@release/compileClasspath': Could not resolve project :porcupine.
Unable to resolve dependency for ':porcupinemanager@releaseUnitTest/compileClasspath': Could not resolve project :porcupine.

Steps to reproduce the behavior

download zip file and execute in Android Studio

Please include enough details so that the issue can reproduced independently by the resolver.

@kenarsa
Copy link
Member

kenarsa commented Jul 31, 2018

how did you open the project? please provide detailed steps so I can help.

@wjdgy3746
Copy link
Author

wjdgy3746 commented Jul 31, 2018

Hello!
I open the project by Android Studio-> File -> Open-> and select the porcupine-master folder->demo->android at Open file or Project window.

@kenarsa
Copy link
Member

kenarsa commented Jul 31, 2018

You need to open /demo/android. Please have a look at README there as well: https://github.com/Picovoice/Porcupine/tree/master/demo/android

@kenarsa kenarsa closed this as completed Jul 31, 2018
@wjdgy3746
Copy link
Author

wjdgy3746 commented Aug 1, 2018

The Problem isn't solved.
I already open /demo/android, but it was not working.
I also read README and created porcupine-debug.aar and added as dependency.

Error message doesn't changed.
Unable to resolve dependency for ':porcupinemanager@debug/compileClasspath': Could not resolve project :porcupine.
Unable to resolve dependency for ':porcupinemanager@debugAndroidTest/compileClasspath': Could not resolve project :porcupine.
Unable to resolve dependency for ':porcupinemanager@debugUnitTest/compileClasspath': Could not resolve project :porcupine.
Unable to resolve dependency for ':porcupinemanager@release/compileClasspath': Could not resolve project :porcupine.
Unable to resolve dependency for ':porcupinemanager@releaseUnitTest/compileClasspath': Could not resolve project :porcupine.

I think in build.gradle(Module:porcupine-debug),
implementation project(':porcupine') is not working properly.

Could you help me to solve this problem?

@kenarsa kenarsa reopened this Aug 1, 2018
@kenarsa
Copy link
Member

kenarsa commented Aug 1, 2018

I am fairly certain that Android binging and demo app are working. But let's try to find the problem here. I need you to outline every single step to open/run the project so I can try to find the problem. thank you.

@wjdgy3746
Copy link
Author

Thank you.
These are the step to open and run the project.

  1. I open 'Porcupine->binding->android' and build.
  2. I get 'porcupine-debug.aar' file in 'Porcupine->binding->android->porcupine->build->outputs->aar'
  3. I open 'Porcupine->demo->android'
  4. I add porcupine-debug.aar module by 'File->New Module->Import .JAR/.AAR Package'
  5. Then, Gradle project sync failed, and Error message comes.

This is project structure.
image

This is build process
image

image

@kenarsa
Copy link
Member

kenarsa commented Aug 1, 2018

OK. Can you please revert all local changes (or get a fresh version of repo). Only open the demo/android project (don't try to build anything manually) and then build that?

@wjdgy3746
Copy link
Author

I got a fresh version of repo.
And only open demo/android project.
Results are following.
image
@kenarsa

@kenarsa
Copy link
Member

kenarsa commented Aug 1, 2018

what is the version of android studio you are using? what version of gradle? whats the OS?

I am using androidstudio 3.1.3 and cannot reproduce the problem.

@wjdgy3746
Copy link
Author

I am using android studio 3.1.3, gradle 4.4, Windows 64 bits.

@kenarsa
Copy link
Member

kenarsa commented Aug 1, 2018

OK. I am building on a Linux box. That is the only difference. Can you build on Linux/Mac?

@wjdgy3746
Copy link
Author

OK. I build on Ubuntu by using VMware Workstation, but same error occurred.

@kenarsa
Copy link
Member

kenarsa commented Aug 1, 2018

Let me think about how to go about debugging this as I need a way to reproduce it. One last question, when you've built on VM did you clone the repository directly into your VM and copied it from your Windows machine?

@wjdgy3746
Copy link
Author

I use the shared folder with Windows machine and VM. I clone the repository and put it in shared foloder.

I try to solve this problem, and another error occurred!
Now I can run the project in emulator. But when I press the START Button, the app is closed.
Logs are following
image

Porcupine.java:28 is "System.loadLibrary("pv_porcupine");".
image

I think project can not load pv_porcupine library.
I tried System.load("direct path"); , but it was still not working.

And there is one more question. How can i figure out which OS i'm using such as arm64-v8a, armeabi-v7a, x86, x86_64?

@kenarsa
Copy link
Member

kenarsa commented Aug 2, 2018

I think I know what the problem is. The project is using symlinks and when you clone it on a Windows machine it probably gets messed up! This is my hunch. An easy test would be to clone from VM directly without Windows involved. Could you give this a try?

Also, Android machinery figures what is your CPU and loads the correct binary.

@wjdgy3746
Copy link
Author

I clone from VM directly and open in Android Studio.
But modules cannot be loaded.
This is pop-up window.
image

I think there is problem with .iml files.

@kenarsa
Copy link
Member

kenarsa commented Aug 2, 2018

I guess the message is pretty self-explanatory. Do the files exist? Can you find them? If not you need to figure out why ...

@ghost
Copy link

ghost commented Aug 7, 2018

Hello, i have been facing this same problem. The first time I cloned and installed the repo it worked like a charm. I have since formatted and now i have this same problem. You may be correct about the symlinks. When i look in the demo/android directory, there is no folder labeled porcupine where when i had the project working i think there once was.

I cloned the repo, installed a fresh version of android studio and the error occurs.
Could not resolve project :porcupine.

@ghost
Copy link

ghost commented Aug 7, 2018

Tried everything I can think of with no success. I will install linux tomorrow and see how it goes there.

@kenarsa
Copy link
Member

kenarsa commented Aug 7, 2018

Hello @ShannonHall, Are you using Windows? Also maybe you can invalidate the cache of AndroidStudio and restart it.

@ghost
Copy link

ghost commented Aug 7, 2018

Yes i am using widows 10, i have done Invalidate Cache/ Restart with no change.

@wjdgy3746
Copy link
Author

I run it using linux and it works! I think there may be a problem running in windows.

@kenarsa
Copy link
Member

kenarsa commented Aug 8, 2018

Thanks. I think the issue is that Windows does not handle symlinks properly. Thanks for helping to debug. Sorry for the inconvenience. I will add this to DOC so that people know about this till we find a long-term solution.

@ghost
Copy link

ghost commented Aug 8, 2018

This I can also confirm its working on Ubuntu 18.04.

@kenarsa
Copy link
Member

kenarsa commented Aug 8, 2018

Thank you @wjdgy3746 and @ShannonHall I am closing the issue and adding a NOTE to documentation that Android demo currently works on Linux and Mac.

@kenarsa kenarsa closed this as completed Aug 8, 2018
@crossplatformdev
Copy link

I am working on my own different project and I can confirm that symbolic links DOES NOT WORK on windows 10. I just landed here reasearching about not working symlinks in Android Studio.

I have a project with its dependencies symlinked inside the folder of the main app project, so I could just add its dependencies and gradle.build files with shorter paths (that was my thought at first) but Android Studio is unable of 'enter across' symbolic links, no matter if they are hard or soft links.

Substituting link's paths by actual dependencies path's does indeed solve the problem.

I am using version 3.2.1 of Android Studio.

@mohammedMaazou
Copy link

for me deactivate antivirus and sync project resolve the problem

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

4 participants