Skip to content

Commit 5c0d7c8

Browse files
committed
made android instructions more general and added VS 2019 support
1 parent d138e2c commit 5c0d7c8

File tree

4 files changed

+104
-33
lines changed

4 files changed

+104
-33
lines changed

BUILD_ANDROID.md

Lines changed: 78 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,118 @@
1-
Please read the [general build guide](BUILD.md) for information on building other platform. Only Android specific instructions are found in this file.
1+
Please read the [general build guide](BUILD.md) for information on building other platforms. Only Android specific instructions are found in this file. **Note that these instructions apply to building for Oculus Quest.**
22

33
# Dependencies
44

5-
Building is currently supported on OSX, Windows and Linux platforms, but developers intending to do work on the library dependencies are strongly urged to use 64 bit Linux as a build platform
5+
Building is currently supported on Windows, OSX and Linux, but developers intending to do work on the library dependencies are strongly urged to use 64 bit Linux as a build platform.
66

7-
You will need the following tools to build Android targets.
7+
### OS specific dependencies
88

9-
* [Android Studio](https://developer.android.com/studio/index.html)
9+
Please install the dependencies for your OS using the [Windows](BUILD_WIN.md), [OSX](BUILD_OSX.md) or [Linux](BUILD_LINUX.md) build instructions before attempting to build for Android.
1010

1111
### Android Studio
1212

13-
Download the Android Studio installer and run it. Once installed, at the welcome screen, click configure in the lower right corner and select SDK manager
13+
Download the [Android Studio](https://developer.android.com/studio/index.html) installer and run it. Once installed, at the welcome screen, click _Configure_ in the lower right corner and select _SDK Manager_.
1414

15-
From the SDK Platforms tab, select API levels 24 and 26.
15+
From the _SDK Platforms_ tab, select API levels 26 and 28.
1616

17-
From the SDK Tools tab select the following
17+
From the _SDK Tools_ tab, select the following
1818

1919
* Android SDK Build-Tools
2020
* GPU Debugging Tools
21-
* CMake (even if you have a separate CMake installation)
2221
* LLDB
2322
* Android SDK Platform-Tools
2423
* Android SDK Tools
2524
* NDK (even if you have the NDK installed separately)
2625

27-
Make sure the NDK installed version is 18 (or higher)
26+
Still in the _SDK Tools_ tab, click _Show Package Details_. Select CMake 3.6.4. Do this even if you have a separate CMake installation.
2827

29-
# Environment
28+
Also, make sure the NDK installed version is 18 (or higher).
3029

31-
Setting up the environment for android builds requires some additional steps
30+
# Environment
3231

33-
#### Set up machine specific Gradle properties
32+
### Create a keystore in Android Studio
33+
Follow the directions [here](https://developer.android.com/studio/publish/app-signing#generate-key) to create a keystore file. You can save it anywhere (preferably not in the `hifi` folder).
3434

35-
Create a `gradle.properties` file in $HOME/.gradle. Edit the file to contain the following
35+
### Set up machine specific Gradle properties
36+
37+
Create a `gradle.properties` file in the `.gradle` folder (`$HOME/.gradle` on Unix, `Users/<yourname>/.gradle` on Windows). Edit the file to contain the following
3638

3739
HIFI_ANDROID_PRECOMPILED=<your_home_directory>/Android/hifi_externals
40+
HIFI_ANDROID_KEYSTORE=<key_store_directory>/<keystore_name>.jks
41+
HIFI_ANDROID_KEYSTORE_PASSWORD=<password>
42+
HIFI_ANDROID_KEY_ALIAS=<key_alias>
43+
HIFI_ANDROID_KEY_PASSWORD=<key_passwords>
44+
45+
Note, do not use $HOME for the path. It must be a fully qualified path name. Also, be sure to use forward slashes in your path.
3846

39-
Note, do not use `$HOME` for the path. It must be a fully qualified path name.
47+
#### If you are building for an Android phone
4048

41-
### Setup the repository
49+
Add these lines to `gradle.properties`
4250

43-
Clone the repository
51+
SUPPRESS_QUEST_INTERFACE
52+
SUPPRESS_QUEST_FRAME_PLAYER
4453

45-
`git clone https://github.com/highfidelity/hifi.git`
54+
#### If you are building for an Oculus Quest
4655

47-
Enter the repository `android` directory
56+
Add these lines to `gradle.properties`
4857

49-
`cd hifi/android`
58+
SUPPRESS_INTERFACE
59+
SUPPRESS_FRAME_PLAYER
5060

51-
Execute two gradle pre-build steps. This steps should only need to be done once, unless you're working on the Android dependencies
61+
The above code to suppress modules is not necessary, but will speed up the build process.
5262

53-
`./gradlew extractDependencies`
63+
### Clone the repository
5464

55-
`./gradlew setupDependencies`
65+
`git clone https://github.com/highfidelity/hifi.git `
5666

5767
# Building & Running
5868

69+
### Building Modules
70+
5971
* Open Android Studio
60-
* Choose _Open Existing Android Studio Project_
72+
* Choose _Open an existing Android Studio project_
6173
* Navigate to the `hifi` repository and choose the `android` folder and select _OK_
74+
* Wait for Gradle to sync (this should take around 20 minutes the first time)
6275
* From the _Build_ menu select _Make Project_
63-
* Once the build completes, from the _Run_ menu select _Run App_
6476

77+
### Running a Module
78+
79+
* In the toolbar at the top of Android Studio, next to the green hammer icon, you should see a dropdown menu.
80+
* You may already see a configuration for the module you are trying to build. If so, select it.
81+
* Otherwise, select _Edit Configurations_.
82+
83+
Your configuration should be as follows
84+
85+
* Type: Android App
86+
* Module: <your module> (you probably want `interface` or `questInterface`)
87+
88+
For the interface modules, you also need to select the activity to launch.
89+
90+
#### For the Android phone interface
91+
92+
* From the _Launch_ drop down menu, select _Specified Activity_
93+
* In the _Activity_ field directly below, put `io.highfidelity.hifiinterface.PermissionChecker`
94+
95+
#### For the Oculus Quest interface
96+
97+
* From the _Launch_ drop down menu, select _Specified Activity_
98+
* In the _Activity_ field directly below, put `io.highfidelity.questInterface.PermissionsChecker`
99+
100+
Note the 's' in Permission**s**Checker for the Quest.
101+
102+
Now you are able to run your module! Click the green play button in the top toolbar of Android Studio
103+
r
104+
# Troubleshooting
105+
106+
To view a more complete debug log,
107+
108+
* Click the icon with the two overlapping squares in the upper left corner of the tab where the sync is running (hover text says _Toggle view_)
109+
* To change verbosity, click _File > Settings_. Under _Build, Execution, Deployment > Compiler_ you can add command-line flags, as per Gradle documentation
110+
111+
Some things you can try if you want to do a clean build
112+
113+
* Delete the `build` and `.externalNativeBuild` folders from the folder for each module you're building (for example, `hifi/android/apps/interface`)
114+
* If you have set your `HIFI_VCPKG_ROOT` environment variable, delete the contents of that directory; otherwise, delete `AppData/Local/Temp/hifi`
115+
* In Android Studio, click _File > Invalidate Caches / Restart_ and select _Invalidate and Restart_
116+
117+
If you see lots of "couldn't acquire lock" errors,
118+
* Open Task Manager and close any running Clang / Gradle processes

BUILD_WIN.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
This is a stand-alone guide for creating your first High Fidelity build for Windows 64-bit.
22
## Building High Fidelity
3-
Note: We are now using Visual Studio 2017 and Qt 5.12.3.
3+
Note: We are now using Visual Studio 2017 or 2019 and Qt 5.12.3.
44
If you are upgrading from previous versions, do a clean uninstall of those versions before going through this guide.
55

66
Note: The prerequisites will require about 10 GB of space on your drive. You will also need a system with at least 8GB of main memory.
77

8-
### Step 1. Visual Studio 2017 & Python
8+
### Step 1. Visual Studio & Python
99

10-
If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/).
10+
If you don’t have Community or Professional edition of Visual Studio, download [Visual Studio Community 2019](https://visualstudio.microsoft.com/vs/). If you have Visual Studio 2017, you are not required to download Visual Studio 2019.
1111

12-
Leave default components.
13-
If you do not already have a python development environment installed, also check "Python Development" in this screen.
12+
When selecting components, check "Desktop development with C++". On the right on the Summary toolbar, select the following components.
1413

15-
If you already have Visual Studio installed and need to add python, open the "Add or remove programs" control panel and find the "Microsoft Visual Studio Installer". Select it and click "Modify". In the installer, select "Modify" again, then check "Python Development" and allow the installer to apply the changes.
14+
#### If you're installing Visual Studio 2017,
15+
16+
* Windows 8.1 SDK and UCRT SDK
17+
* VC++ 2015.3 v14.00 (v140) toolset for desktop
18+
19+
#### If you're installing Visual Studio 2019,
20+
21+
* MSVC v141 - VS 2017 C++ x64/x86 build tools
22+
* MSVC v140 - VS 2015 C++ build tools (v14.00)
23+
24+
If you do not already have a Python development environment installed, also check "Python Development" in this screen.
25+
26+
If you already have Visual Studio installed and need to add Python, open the "Add or remove programs" control panel and find the "Microsoft Visual Studio Installer". Select it and click "Modify". In the installer, select "Modify" again, then check "Python Development" and allow the installer to apply the changes.
1627

1728
### Step 1a. Alternate Python
1829

@@ -29,7 +40,12 @@ Run Command Prompt from Start and run the following commands:
2940
`cd "%HIFI_DIR%"`
3041
`mkdir build`
3142
`cd build`
32-
`cmake .. -G "Visual Studio 15 Win64"`
43+
44+
#### If you're using Visual Studio 2017,
45+
Run `cmake .. -G "Visual Studio 15 Win64"`.
46+
47+
#### If you're using Visual Studio 2019,
48+
Run `cmake .. -G "Visual Studio 16 2019" -A x64`.
3349

3450
Where `%HIFI_DIR%` is the directory for the highfidelity repository.
3551

interface/resources/meshes/defaultAvatar_full.fst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = mannequin
22
type = body+head
3-
scale = 2
3+
scale = 1
44
filename = mannequin/mannequin.baked.fbx
55
joint = jointNeck = Neck
66
joint = jointLean = Spine

interface/src/Application.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7038,7 +7038,8 @@ void Application::updateWindowTitle() const {
70387038
}
70397039
}
70407040

7041-
QString title = "Anna was here :)";
7041+
QString title = QString() + (!username.isEmpty() ? username + " @ " : QString())
7042+
+ currentPlaceName + connectionStatus + loginStatus + buildVersion;
70427043

70437044
#ifndef WIN32
70447045
// crashes with vs2013/win32

0 commit comments

Comments
 (0)