Install Filepath Errors with Android NDK and Tools

I didn’t have any problems getting Android checked off in the Setup Assistant. However, when I attempted to create a test project, I did run into filepath problems. I’m still working my way through the documentation in an attempt to get this working.

http://docs.aws.amazon.com/lumberyard/latest/userguide/android-game-configuring.html

My configuration information:

Third-party location: F:/Programs/Lumberyard/1.11.1.0/3rdParty

Capabilities available, [x] enabled - [ ] disabled:

[X] rungame - Run your game project

[X] runeditor - Run the Lumberyard Editor and tools

[X] compilegame - Compile the game code

[ ] compileengine - Compile the engine and asset pipeline

[ ] compilesandbox - Compile the Lumberyard Editor and tools

[X] compileandroid - Compile for Android devices

[ ] setuplinux - Setup for Linux Dedicated Server

Compilers available, [x] enabled - [ ] disabled:

[ ] vc120 - Visual Studio 2013

[X] vc140 - Visual Studio 2015

The filepaths for both ‘android-ndk-r16b’ and ‘sdk-tools-windows-3859397’ look correct. Initially I used the full names for those directories. I haven’t checked to see if the filepath length is a problem in this case. However, I did shorten the directory names to the following . . .

Location of the Android files:

F:/Programs > Lumberyard > 1.11.1.0 > 3rdParty > Android

ndk-r16b

sdk-tools

Initially there was a problem finding the ‘platforms’ directory.

File “Tools/build/waf-1.7.13/lmbrwaflib\android.py”, line 352, in configure installed_sdk_versions = os.listdir(os.path.join(sdk_root, ‘platforms’)) WindowsError: [Error 3] The system cannot find the path specified: ‘F:/Programs/Lumberyard/1.11.1.0/3rdParty/Android/sdk-tools\platforms/.’ Process failed with return code: 1

I didn’t find a ‘platforms’ directory anywhere in ‘sdk-tools-windows-3859397’, but there is one in ‘android-ndk-r16b’. I copied the ‘platforms’ directory from ‘android-ndk-r16b’ to ‘sdk-tools-windows-3859397’, which may have solved that problem. However, I then had the following filepath error:

File “Tools/build/waf-1.7.13/lmbrwaflib\android.py”, line 424, in configure build_tools_dir_contents = os.listdir(build_tools_dir) WindowsError: [Error 3] The system cannot find the path specified: ‘F:/Programs/Lumberyard/1.11.1.0/3rdParty/Android/sdk-tools\build-tools/.’ Process failed with return code: 1

There is a ‘tools’ directory in the ‘sdk-tools-windows-3859397’ folder and there is a ‘build’ directory in the ‘android-ndk-r16b’ folder. Unfortunately, I didn’t find a ‘build-tools’ directory anywhere. I like to think this is an easy fix; just a matter of finding out the correct directory names/locations for everything. I’ll keep digging, but any suggestions or help would be welcome.

Thanks!

Hi Douglas,

I apologize for the delayed answer. I thought I had posted an answer yesterday but it does nlot look like the forums actually took my answer.

My guess is that your paths in SetupAssistant are not setup correctly for Android SDK and Android NDK.

When I run SetupAssistant on macOS I have the following paths set:
Android NDK: /Developer/Amazon/lyengine/3rdParty/android-ndk/r12/ndk-build

  • Notice path points into the NDK

Android SDK: /Developer/Android/android-sdk/android

  • Note: For the SDK setting that path was awkward - when I click on the browse button I had to go to android-sdk/Tools/ and click on the Android executable. When I did that I got the Android SDK path shown above.

I am able to build Android with this setup. For windows the paths look the same so I recommend verifying your paths in SetupAssistant again. Feel free to post an image of the paths in SetupAssistant that you have.

Thanks,
Chris

Thanks for the suggestion!

There is an ndk-build.cmd in the ndk-r16b directory as well as another one in the ‘build’ directory. I switched to the second option as suggested and gave it another try.

Unfortunately, I still have the same error finding ‘build-tools’ or at least it looks the same.

File "Tools/build/waf-1.7.13/lmbrwaflib\android.py", line 424, in configure

build_tools_dir_contents = os.listdir(build_tools_dir)
WindowsError: [Error 3] The system cannot find the path specified:

F:/Programs/Lumberyard/1.11.1.0/3rdParty/Android/sdk-tools\build-tools/.

Process failed with return code: 1

Hmmm, perhaps you don’t have the right android-sdk in place. If I list the contents of my android-sdk directory this is what I get:

08/14/2017 08:43 AM 16 .knownPackages
05/11/2017 11:34 AM <DIR> add-ons
07/02/2014 11:03 AM 220,209 AVD Manager.exe
08/14/2017 08:35 AM <DIR> build-tools
08/14/2017 08:33 AM <DIR> emulator
08/14/2017 08:34 AM <DIR> extras
08/14/2017 08:33 AM <DIR> patcher
08/14/2017 08:33 AM <DIR> platform-tools
08/09/2017 02:10 PM <DIR> platforms
09/03/2015 08:56 AM <DIR> samples
07/02/2014 11:03 AM 220,721 SDK Manager.exe
07/02/2014 11:03 AM 1,170 SDK Readme.txt
09/03/2015 09:01 AM <DIR> sources
08/09/2017 02:14 PM <DIR> system-images
08/09/2017 02:18 PM <DIR> temp
08/14/2017 08:36 AM <DIR> tools

Did you download the SDK with Android Studio or separately? Did you put it directly into 3rdParty or did you copy the files there? Just trying to figure out what has gone wrong. :slight_smile:

Thanks,
Chris

<< Did you download the SDK with Android Studio or separately? Did you put it directly into 3rdParty or did you copy the files there? >>

Those are good questions.

It looks like your directory names are different than mine. I’m using the PC version.

As recommended, I downloaded the SDK and Tools separately. I have not downloaded Android Studio. I copied – or used cut and paste – the directories to the current location.

Here are the directories and the files contained in the Android NDK and Tools, which I placed in the Lumberyard > 3rdParty > Android directory.

First, the ndk directory:

Android > ndk-r16b >

build >

meta >

platforms >

python-packages >

shader-tools >

simpleperf >

sources >

sysroot >

toochains >

CHANGELOG.md

ndk-build.cmd

ndk-depends.cmd

ndk-gdb.cmd

ndk-stack.cmd

README.md

source.properties

Secondly, the tools:

Android > sdk-tools

platforms >

tools >

The ‘platforms’ directory has android-14 to android-27 and I configured the settings to use android-23. The ‘tools’ directory has the android.bat file.

Here is an image showing my directories:

Looks like you don’t have the android-sdk correctly installed. My directory listing was from PC and so it should match what you see on your computer.

Here are the basic steps to install the SDK:

  1. You can install the Android SDK with Android Studio first. Here is the link for downloading that package from Google:Android Studio + SDK
  2. You will want to run the SDK manager. Start up Android Studio and in the welcome screen click on Configure in the bottom corner then click on SDK Manager in the list.
  3. Select SDK 23, which you have configured Lumberyard to use
  4. Under the “SDK Tools” You can also install Android Support Repository, Google Play services (APK expansion, billing, licensing), Google repository, and Google USB driver
  5. Update your windows environment path to include the Android SDK platform-tools and tools directory.
  6. Update SetupAssistant android-sdk path to point to the location it was installed by the Android Studio + SDK download.
    Hopefully that should clear things up and get you up and running on Android.

Thanks,
Chris

Thank you! I think I now have Lumberyard set up for Android, but I still haven’t successfully created a project.

Step 1.

The link to the Android download wasn’t working, so I used the following:

https://developer.android.com/studio/index.html#downloads

I saw the notice that sdk tools are included in Android Studio.

I installed Android Studio. It installed on my C drive.

C:\Program Files\Android\Android Studio

Install location of additional SDK files:

*C:\Users\Douglas\AppData\Local\Android\Sdk*

Step 2.

I ran Android Studio and selected the Configure option.

I selected SDK 23

I also installed most of the options you recommended

Step 3.

Add the Environment Paths for Android to Windows User variables

C:\Users\Douglas\AppData\Local\Android\Sdk\platform-tools

C:\Users\Douglas\AppData\Local\Android\Sdk\tools

So far so good! =)

Step 4.

I then ran the Lumberyard Setup Assistant and attempted to set the android-sdk path.
However, the Setup Assistant would like me to locate and set the ndk-build.cmd file.
I was unable to find the file and a search on the Android directories failed to
locate one. I also searched the C drive to no avail.

Assuming this needs to be downloaded and installed seperately . . .

https://developer.android.com/ndk/downloads/index.html

No installer for this. I placed the android-ndk-r16b files into a Lumberyard
3rdParty > Android directory I created. I then set the following in the
install required software in the Lumberyard Setup Assistant:

F:\Programs\Lumberyard\1.12.0.0\3rdParty\Android\android-ndk-r16b

C:\Users\Douglas\AppData\Local\Android\Sdk\tools

Next Up, Installing the Java SDK . . .

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Step 5.

Add the Environment Paths for Java to Windows User variables

F:\Programs\Lumberyard\1.12.0.0\3rdParty\Java\jdk1.8.0_152

F:\Programs\Lumberyard\1.12.0.0\3rdParty\Java\jre1.8.0_152

At this point I attempted to create a new project. It failed.
I made a second attempt, but with the similar results. I then
tried the next step before making another attempt.

Step 6.

Initialize the build system from the command line in the /lumberyard/dev directory

lmbr_waf.bat configure

The third attempt to create a new project failed. The failure
appears to be the same issue in all three attempts. I think I
have made good progress, but still falling short of success.

See the attached images and error logs for more details.

6120-installationsteps.zip (721 KB)installationsteps.zip

Looked at the log files and it looks like you have made progress so that is good news! The error in the log files is this: f:\Programs\Lumberyard\1.12.0.0\dev\BinTemp\win_x64_vs2015_profile\Code\Launcher\WindowsLauncher\TestProjectWindowsLauncher_rc\TestProjectWindowsLauncher.auto_gen.rc(10) : fatal error RC1015: cannot open include file ‘afxres.h’.

Looks like you might night have MFC installed properly on your computer. Go into Programs/Features, select Visual Studio and modify it. Then look for the Add Microsoft Foundation Classes option and select that. That should resolve the issue.

The good news, with your help I think I solved the immediate installation problems. I was able to start up the editor and run the ‘StarterGame’. Huzzah! And there was much rejoicing. Unfortunately, when my TestProject is set to default the Editor runs into errors and fails to run.

However, to get the StarterGame working… I know I installed the MFC Library previously, but I probably forgot to do so again when I updated. Checking to verify/install the MFC Library in Visual Studio 2015. I found the following link helpful:

http://docs.aws.amazon.com/lumberyard/latest/userguide/setting-up-system-requirements.html

I added the MFC Library and I also added Common Tools, although when I was looking at it again later it was no longer checked.

Then I verified the filepath for the Lumberyard Editor shortcut, although I don’t think this is usually an issue. However, with the various updates I wanted to be sure I was using the correct version. The filepath is correct for my setup.

F:\Programs\Lumberyard\1.12.0.0\dev\Bin64vc140\Editor.exe

I then checked the user_settings.options and the default_settings to verify the correct version of MSVS was set. Both files were set properly.

Ran lmbr_waf configure again.

At this point I think it is all good for the existing projects. Unfortunately, I suspect if I need to build a new project before I run it in the Editor, I may have a problem. However, this may be related to different issues recently posted on the forums and I don’t think this is an Android filepath problem any more. Since I am getting the same error, I’ll post my what I tried and the results in the following discussion:

https://forums.awsgametech.com/t/loads-of-errors/4449/1