0

I'm 99% positive this is a total nub question but I downloaded the pocketsphinx demo project: https://github.com/cmusphinx/pocketsphinx-android-demo and was told in the tutorial to just import the project into Android Studio and then all the dependencies would be pulled automatically. I don't doubt this is the case but when I tried importing the project I got a dialog asking me to "Import Gradle Project". I'm confused because it sounds like it's looking for a component of the project but there's nothing I could find in there that AS was looking for. Is this included in the project or do I have to download Gradle?

Edit:

I try to import the project

enter image description here

I hit okay and this pops up:

enter image description here

Jpaji Rajnish
  • 1,491
  • 4
  • 17
  • 35

3 Answers3

3

1.1 - Importing Gradle projects

On Android studio start click this option, or in file File -> Import...

enter image description here

Unzip and locate the package like so... and import...

enter image description here

1.2 - Gradle - Home Directory & Download

  1. Download Gradle http://www.gradle.org/downloads
  2. Unzip / Install
  3. Set Gradle home to the install directory
Gready
  • 1,134
  • 8
  • 15
  • I did exactly that and then it prompted me with an "Import Gradle Project" dialog. Where is the gradle project it's looking for? – Jpaji Rajnish Apr 21 '15 at 16:21
  • It prompts me to find a gradle project on my hard drive. – Jpaji Rajnish Apr 21 '15 at 16:29
  • Upzip the contents of `pocketsphinx-android-demo-master.zip`, when android studio prompts you for the `Gradle project` simply navigate to the upzipped file `pocketsphinx-android-demo-master` and select _that_ folder. That folder _is_ the gradle project. (Check my 2nd image) – Gready Apr 21 '15 at 16:31
  • I cloned the repo from github. Where did the zip come from? – Jpaji Rajnish Apr 21 '15 at 16:50
  • You should simply select the folder under the git repository folder... `github\pocketsphnix-` – Gready Apr 21 '15 at 17:02
  • I cloned from the repository link. – Jpaji Rajnish Apr 21 '15 at 19:30
  • You need a local copy of the cloned repository on your hard-drive, when you've done that follow the steps I've outlined above. – Gready Apr 21 '15 at 19:31
  • Lol yes I have a local copy and have been directing AS to it the whole time. Why is it asking me where the gradle project is after I try to import my local version of the repo? Why does it want this? Where can it be found? Is it included somewhere in this project? – Jpaji Rajnish Apr 21 '15 at 19:46
  • The Gradle project is included within the repo. It works fine for me from their repository. – Gready Apr 21 '15 at 19:47
  • Also I don't know if this is significant but my AS just says "Import Project" and doesn't have the parentheses like yours. I downloaded AS just a week or 2 ago. – Jpaji Rajnish Apr 21 '15 at 19:49
  • That shouldn't effect you. It works if you import from File -> Import also. – Gready Apr 21 '15 at 19:52
  • Edited my answer, check the bottom of my answer, it's at the bottom. :-) – Gready Apr 21 '15 at 20:42
0

You can check if your machine has gradle by running gradle -v. If the command is not found, you do you not have gradle installed. If you do not have gradle installed on your machine, you need to take the steps to install for your machine.

If you are running a linux based machine the steps located at http://gradle.org/install will assist you. However if you are running a windows machine, the steps are a bit different and can vary depending on which version of windows you are using. This tutorial can help you http://howtoprogram.xyz/2016/09/14/install-gradle-windows/.

Once you have successfully installed gradle, set your gradle home to the location of the folder you choose.

0

Just add RapidSphinx library to build.gradle app. That's library can help You to use Pocketsphinx without dealing with Pocketsphinx assets and configuration.

icaksama
  • 712
  • 10
  • 15