From a9fd6e2d4e709dd5c497c832a245f3f245eabe83 Mon Sep 17 00:00:00 2001 From: ArcadeFever Date: Sat, 10 Oct 2020 19:13:34 -0700 Subject: [PATCH 1/5] Updated instructions for building Oculus Quest with latest Android Studio, including additional troubleshooting tips. --- BUILD_ANDROID.md | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md index 0bea3e5a90..32f8242523 100644 --- a/BUILD_ANDROID.md +++ b/BUILD_ANDROID.md @@ -1,6 +1,6 @@ # Build Android -*Last Updated on December 21, 2019* +*Last Updated on October 9, 2020* 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.** @@ -14,7 +14,7 @@ Please install the dependencies for your OS using the [Windows](BUILD_WIN.md), [ ### Android Studio -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_. +Download the [Android Studio](https://developer.android.com/studio/index.html) installer and run it. Once installed, click _File_ then _Settings_, expand _Appearance & Behavior_ then expand _System Settings_ and select _Android SDK_. From the _SDK Platforms_ tab, select API levels 26 and 28. @@ -27,14 +27,16 @@ From the _SDK Tools_ tab, select the following * Android SDK Tools * NDK (even if you have the NDK installed separately) -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. +Still in the _SDK Tools_ tab, check off _Show Package Details_ at the bottom. Select CMake 3.6.4. Do this even if you have a separate CMake installation. Also, make sure the NDK installed version is 18 (or higher). -Also, make sure the NDK installed version is 18 (or higher). +Now go back to _File_ then _Project Structure_ then under _Project_ set the Android Gradel Plugin Version to `3.2.1` and Gradel Version to `4.10.1`. + +If Android Studio pops open the "Plugin Update Recommeded" dialog, do not click update, just click X on the top right to close. Later versions of the gradel plugin have known issues with cz.malohlava. ## Environment ### Create a keystore in Android Studio -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). +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 `project-athena` folder). ### Set up machine specific Gradle properties @@ -62,7 +64,11 @@ Add these lines to `gradle.properties` SUPPRESS_INTERFACE SUPPRESS_FRAME_PLAYER -The above code to suppress modules is not necessary, but will speed up the build process. + +#### The Frame Player for both Android Phone and Oculus Quest is optional, so if you encounter problems with these during your build, you can skip them by adding these lines to `gradle.properties` + + SUPPRESS_FRAME_PLAYER + SUPPRESS_QUEST_FRAME_PLAYER ### Clone the repository @@ -74,12 +80,17 @@ The above code to suppress modules is not necessary, but will speed up the build * Open Android Studio * Choose _Open an existing Android Studio project_ -* Navigate to the `hifi` repository and choose the `android` folder and select _OK_ +* Navigate to the `project-athena` repository you cloned and choose the `android` folder and select _OK_ * Wait for Gradle to sync (this should take around 20 minutes the first time) -* From the _Build_ menu select _Make Project_ +* If a dialog pops open saying "Plugin Update Recommeded" dialog, do not click update, just click X on the top right to close. +* In the _Projet_ window click on the project you wish to build (i.e. "questInterface") then click _Build_ in the top menu and choose _Make Module 'questInterface'_ +* By default this will build the "debug" apk, you can change this by opening the _Build Varients_ window along the left side and select other build types like "release" +* Your newly build APK should reside in project-athena\android\apps\questInterface\release (if you chose release) ### Running a Module +You are free to use "abd" command line or other development tools to install (sideload on quest) your newly build APK, or you can follow the instrutions below to load the APK via Android Studio. + * In the toolbar at the top of Android Studio, next to the green hammer icon, you should see a dropdown menu. * You may already see a configuration for the module you are trying to build. If so, select it. * Otherwise, select _Edit Configurations_. @@ -112,9 +123,17 @@ To view a more complete debug log, * 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_) * To change verbosity, click _File > Settings_. Under _Build, Execution, Deployment > Compiler_ you can add command-line flags, as per Gradle documentation +If you encounter cmake issues, try adding the following system environment variable: + +Naviagte to 'Edit the System Environment Variables' Through the start menu. +* Click on 'Advanced' tab, then 'Environment Variables' +* Select 'New' under System variables +* Set "Variable name" to QT_CMAKE_PREFIX_PATH +* Set "Variable value" the directory that your android build placed the cmake 3.6.4 library cmake directory (i.e. android\qt\lib\cmake) + Some things you can try if you want to do a clean build -* Delete the `build` and `.externalNativeBuild` folders from the folder for each module you're building (for example, `hifi/android/apps/interface`) +* Delete the `build` and `.externalNativeBuild` folders from the folder for each module you're building (for example, `project-athena/android/apps/interface`) * If you have set your `HIFI_VCPKG_ROOT` environment variable, delete the contents of that directory; otherwise, delete `AppData/Local/Temp/hifi` * In Android Studio, click _File > Invalidate Caches / Restart_ and select _Invalidate and Restart_ From db9a4143dfe355b8cf958a620fb720557340f6d8 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Tue, 15 Dec 2020 01:34:47 -0500 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: kasenvr <52365539+kasenvr@users.noreply.github.com> --- BUILD_ANDROID.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md index 32f8242523..1d93fe6248 100644 --- a/BUILD_ANDROID.md +++ b/BUILD_ANDROID.md @@ -83,13 +83,13 @@ Add these lines to `gradle.properties` * Navigate to the `project-athena` repository you cloned and choose the `android` folder and select _OK_ * Wait for Gradle to sync (this should take around 20 minutes the first time) * If a dialog pops open saying "Plugin Update Recommeded" dialog, do not click update, just click X on the top right to close. -* In the _Projet_ window click on the project you wish to build (i.e. "questInterface") then click _Build_ in the top menu and choose _Make Module 'questInterface'_ -* By default this will build the "debug" apk, you can change this by opening the _Build Varients_ window along the left side and select other build types like "release" -* Your newly build APK should reside in project-athena\android\apps\questInterface\release (if you chose release) +* In the _Project_ window click on the project you wish to build (i.e. "questInterface") then click _Build_ in the top menu and choose _Make Module 'questInterface'_ +* By default this will build the "debug" apk, you can change this by opening the _Build Variants_ window along the left side and select other build types such as "release". +* Your newly build APK should reside in `project-athena\android\apps\questInterface\release` (if you chose release). ### Running a Module -You are free to use "abd" command line or other development tools to install (sideload on quest) your newly build APK, or you can follow the instrutions below to load the APK via Android Studio. +You are free to use "abd" command line or other development tools to install (sideload on Quest) your newly built APK, or you can follow the instructions below to load the APK via Android Studio. * In the toolbar at the top of Android Studio, next to the green hammer icon, you should see a dropdown menu. * You may already see a configuration for the module you are trying to build. If so, select it. @@ -129,7 +129,7 @@ Naviagte to 'Edit the System Environment Variables' Through the start menu. * Click on 'Advanced' tab, then 'Environment Variables' * Select 'New' under System variables * Set "Variable name" to QT_CMAKE_PREFIX_PATH -* Set "Variable value" the directory that your android build placed the cmake 3.6.4 library cmake directory (i.e. android\qt\lib\cmake) +* Set "Variable value" to the directory that your android build placed the cmake 3.6.4 library cmake directory (i.e. android\qt\lib\cmake). Some things you can try if you want to do a clean build @@ -138,4 +138,4 @@ Some things you can try if you want to do a clean build * In Android Studio, click _File > Invalidate Caches / Restart_ and select _Invalidate and Restart_ If you see lots of "couldn't acquire lock" errors, -* Open Task Manager and close any running Clang / Gradle processes \ No newline at end of file +* Open Task Manager and close any running Clang / Gradle processes From daf3ab3e928c242951883cbc638e388c1595e93e Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Tue, 15 Dec 2020 01:42:37 -0500 Subject: [PATCH 3/5] Apply suggestions from code review --- BUILD_ANDROID.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md index 1d93fe6248..c0eecd3b33 100644 --- a/BUILD_ANDROID.md +++ b/BUILD_ANDROID.md @@ -1,6 +1,6 @@ # Build Android -*Last Updated on October 9, 2020* +*Last Updated on December 15, 2020* 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.** @@ -36,7 +36,7 @@ If Android Studio pops open the "Plugin Update Recommeded" dialog, do not click ## Environment ### Create a keystore in Android Studio -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 `project-athena` folder). +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 `vircadia` folder). ### Set up machine specific Gradle properties @@ -80,16 +80,16 @@ Add these lines to `gradle.properties` * Open Android Studio * Choose _Open an existing Android Studio project_ -* Navigate to the `project-athena` repository you cloned and choose the `android` folder and select _OK_ +* Navigate to the `vircadia` repository that had you cloned and choose the `android` folder and select _OK_ * Wait for Gradle to sync (this should take around 20 minutes the first time) * If a dialog pops open saying "Plugin Update Recommeded" dialog, do not click update, just click X on the top right to close. * In the _Project_ window click on the project you wish to build (i.e. "questInterface") then click _Build_ in the top menu and choose _Make Module 'questInterface'_ * By default this will build the "debug" apk, you can change this by opening the _Build Variants_ window along the left side and select other build types such as "release". -* Your newly build APK should reside in `project-athena\android\apps\questInterface\release` (if you chose release). +* Your newly build APK should reside in `vircadia\android\apps\questInterface\release` (if you chose release). ### Running a Module -You are free to use "abd" command line or other development tools to install (sideload on Quest) your newly built APK, or you can follow the instructions below to load the APK via Android Studio. +You are free to use the "adb" command line or other development tools to install (sideload on Quest) your newly built APK, or you can follow the instructions below to load the APK via Android Studio. * In the toolbar at the top of Android Studio, next to the green hammer icon, you should see a dropdown menu. * You may already see a configuration for the module you are trying to build. If so, select it. @@ -123,17 +123,17 @@ To view a more complete debug log, * 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_) * To change verbosity, click _File > Settings_. Under _Build, Execution, Deployment > Compiler_ you can add command-line flags, as per Gradle documentation -If you encounter cmake issues, try adding the following system environment variable: +If you encounter CMake issues, try adding the following system environment variable: -Naviagte to 'Edit the System Environment Variables' Through the start menu. +With your start menu, search for 'Edit the System Environment Variables' and open it. * Click on 'Advanced' tab, then 'Environment Variables' * Select 'New' under System variables * Set "Variable name" to QT_CMAKE_PREFIX_PATH -* Set "Variable value" to the directory that your android build placed the cmake 3.6.4 library cmake directory (i.e. android\qt\lib\cmake). +* Set "Variable value" to the directory that your android build placed the CMake 3.6.4 library CMake directory (i.e. android\qt\lib\cmake). Some things you can try if you want to do a clean build -* Delete the `build` and `.externalNativeBuild` folders from the folder for each module you're building (for example, `project-athena/android/apps/interface`) +* Delete the `build` and `.externalNativeBuild` folders from the folder for each module you're building (for example, `vircadia/android/apps/interface`) * If you have set your `HIFI_VCPKG_ROOT` environment variable, delete the contents of that directory; otherwise, delete `AppData/Local/Temp/hifi` * In Android Studio, click _File > Invalidate Caches / Restart_ and select _Invalidate and Restart_ From 2a849358f8f0ea784d30d054e477ffe6af825237 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Tue, 15 Dec 2020 04:13:18 -0500 Subject: [PATCH 4/5] Update BUILD_ANDROID.md --- BUILD_ANDROID.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md index c0eecd3b33..47a3a4434b 100644 --- a/BUILD_ANDROID.md +++ b/BUILD_ANDROID.md @@ -29,9 +29,9 @@ From the _SDK Tools_ tab, select the following Still in the _SDK Tools_ tab, check off _Show Package Details_ at the bottom. Select CMake 3.6.4. Do this even if you have a separate CMake installation. Also, make sure the NDK installed version is 18 (or higher). -Now go back to _File_ then _Project Structure_ then under _Project_ set the Android Gradel Plugin Version to `3.2.1` and Gradel Version to `4.10.1`. +Now go back to _File_ then _Project Structure_ then under _Project_ set the Android Gradle Plugin Version to `3.2.1` and Gradle Version to `4.10.1`. -If Android Studio pops open the "Plugin Update Recommeded" dialog, do not click update, just click X on the top right to close. Later versions of the gradel plugin have known issues with cz.malohlava. +If Android Studio pops open the "Plugin Update Recommeded" dialog, do not click update, just click X on the top right to close. Later versions of the Gradle plugin have known issues with cz.malohlava. ## Environment From c57d3ab8d0f9ddba6519fe9d809b8810988f1a8a Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Sat, 20 Feb 2021 18:11:59 -0500 Subject: [PATCH 5/5] Update BUILD_ANDROID.md --- BUILD_ANDROID.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md index 47a3a4434b..cc894618cf 100644 --- a/BUILD_ANDROID.md +++ b/BUILD_ANDROID.md @@ -2,7 +2,7 @@ *Last Updated on December 15, 2020* -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.** +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 the Oculus Quest 1.** ## Dependencies