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

Build command fails with "The system cannot find the path specified" #45

Closed
JudahGabriel opened this issue Dec 3, 2019 · 10 comments · Fixed by #47
Closed

Build command fails with "The system cannot find the path specified" #45

JudahGabriel opened this issue Dec 3, 2019 · 10 comments · Fixed by #47
Labels
bug Something isn't working

Comments

@JudahGabriel
Copy link
Contributor

Using the latest llama-pack instructions, I'm able to successfully execute the init command.

After completing the init command, I execute the build command and receive the following error:

PS C:\Dev\llama-pack> npx GoogleChromeLabs/llama-pack#0.1.0 build
(node:23244) ExperimentalWarning: The fs.promises API is experimental
Installing Android Build Tools. Please, read and accept the license agreement
Installing Build Tools
The system cannot find the path specified.
undefined

After the error, the tool exits.

When it says "system cannot find the path specified", it's not clear to me which path is being referred to, though I suspect it's the Android SDK path. When I first ran the init command, it prompted me for paths to JDK and Android SDK; my llama-pack-config.js looks like this:

'use strict';
module.exports = {
  jdkPath: 'C:/Program Files/AdoptOpenJDK/jdk-8.0.232.09-hotspot/', // Path to the JDK 8
  androidSdkPath: 'C:/AndroidTools/' // Path to the Android SDK
};

Any idea why I may be getting this path error? I'm on Windows 10 Enterprise using Powershell.

@andreban
Copy link
Member

andreban commented Dec 4, 2019

Thanks for filing this.

The issue seems to be happening in this section of code.

My guess is that it's not resolving the correct path, and we probably need to change it to use path.posix.join on Linux / MacOS and path.win32.join on Windows.

I'll try reproducing this and confirming if that's indeed the case on a Windows environment later today.

@andreban andreban added bug Something isn't working good first issue Good for newcomers labels Dec 4, 2019
@andreban
Copy link
Member

andreban commented Dec 5, 2019

This should have been fixed on #47 - It was breaking when the command-line had spaces in it, and everything after the first space was being treated as parameters. Please, re-open if the issue is still happening.

@JudahGabriel
Copy link
Contributor Author

JudahGabriel commented Dec 9, 2019

Does my command line need to change, or is it still npx GoogleChromeLabs/llama-pack#0.1.0 build?

Just running that command still gives me the error. I suspect it's related to the paths for JDK and Android Tools - where are those paths stored now? I'd like to verify they're set right.

@andreban
Copy link
Member

I haven't created a tag for the new version yet (and 0.1.0 has the issue). Running npx GoogleChromeLabs/llama-pack will run things agains the master branch and should work.

@JudahGabriel
Copy link
Contributor Author

JudahGabriel commented Dec 10, 2019

Unfortunately, running it against master still gives me the error:

image

How do I debug this? It's not clear to me where npx is putting llama-pack files, nor where llama-pack is storing the configuration (SDK paths, etc.).

@andreban andreban reopened this Dec 11, 2019
@andreban
Copy link
Member

Re-opening, since you are still running into the issue.

I am not able to repro on my Windows environment. So, trying to understand how to reproduce.

The config file location is defined as the following:

const homedir = require('os').homedir();
const CONFIG_FILE_NAME = path.join(homedir, '/.llama-pack/llama-pack-config.json');

On my Windows environment this is C:\Users\Andre\.llama-pack\llama-pack-config.json.

@JudahGabriel, would it be possible for you to clone the project, run npm install and execute from your machine? I'd like to eliminate any issues from using npx.

git clone https://github.com/GoogleChromeLabs/llama-pack.git
cd llama-pack
npm i
npm run build

Then, from the path you want to build a project:

<path-to-llama-pack>\bin\llama-pack.js build

Andre

@andreban andreban removed the good first issue Good for newcomers label Dec 11, 2019
@JudahGabriel
Copy link
Contributor Author

Perfect, thanks. I'll have a look here and see.

FYI, my llama-pack.config looks like this:

{
   "jdkPath": "C:\\Program Files\\AdoptOpenJDK\\jdk-8.0.232.09-hotspot",
   "androidSdkPath": "C:\\AndroidTools\\tools"
}

I'll try running npm run build instead of npx and see what happens.

@JudahGabriel
Copy link
Contributor Author

OK, did that, got the same error.

Since I'm using npm run, I can probably just debug this on my end now, as I can edit the generated JS files and track down what's going on. I'll post a follow-up here shortly.

@JudahGabriel
Copy link
Contributor Author

JudahGabriel commented Dec 11, 2019

OK, so I think it's my fault: the androidSdkPath was set to C:\AndroidTools\Tools. It shouldn't have that last \Tools directory in there; I think that's the issue.

I had tools in there from the previous version before the npx change, where it was looking for something in the tools directory.

Thanks for helping solve this one.

@andreban
Copy link
Member

Thanks for checking this out. Seems like we need a better error message. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants