[FIX] Installing app problems with codeworks

So I recently switched to the master branch and started to integrate background/scheduled notification on android. Let’s see how I fixed some problems I faced. We start by packaging the project for android (ETC1). Everything goes smoothly and we end up with 4 files on our build folder:


Plug in on our phone and double click the Install* batch file.
c20786d5ebba426ebe342adc3f672ddd.png
What!? How did that happen? My oneplus one has like 20gigs of storage left! Let’s open up that batch file on our favorite program (Sublime text :slight_smile: ).
With a quick glance and a googling attempt I found out that this like is causing issues.


if not "%1"=="" set DEVICE=-s %1

The -s flag indicates that our app should be installed on external storage(aka sd card). This is stupid because many phones may either not support an sd card (OnePlus One, Nexus, etc) or may not have an sd card plugged in! REMOVE THAT LINE. Continuing into further investigation of the code I also found out about a couple of other problems:

  1. The

goto:eof

line causes problems. It simply shuts down the command prompt without giving us time to take a look into the messages printed on the screen. Add a :eof marker before the @pause on the end of the file.


set ANDROIDHOME=%ANDROID_HOME%
if "%ANDROIDHOME%"=="" set ANDROIDHOME=E:/NVPACK/android-sdk-windows
set ADB=%ANDROIDHOME%\platform-tools\adb.exe

This line forces you to use nVidias codeworks for your sdk and your adb. Sometimes you might not want to do that and use your own sdk and adb (that you have installed through SDK manager probably). Changing these lines is your choice though.

I don’t believe you understood what the batch file does. The DEVICE=-s %1 is to add an optional device id to the ADB command. This lets you have more than one Android device connected and decide on the commandline to the batch file which serial number to use, not pick storage location.

We do not insert a pause since a lot of people automate installs and don’t want to have to hit a key (think about running the batch file with multiple device ids to do testing).

Finally, the ANDROID_HOME environment variable will override the fallback. The fallback (in this case E:/NVPACK/android-sdk-windows) was what it was set to on the machine you packaged on) is only used if it isn’t defined. The batch files are meant to be used on machines which are properly configured for development.

My machine is properly configured for development; I have been using Android Studio for quite some time. I have also uploaded a couple of apps to the PlayStore (Java only, not Unreal). I also have a couple versions of the sdk installed (4.0,4.4,5.0,6.0).

As for the pause I was not aware of that. Sorry for the inconvenience (but still it solved my installation issue :confused: )