Build fails on Android Device Launch

When playing the game normally in editor, it runs just fine. Also when I create a plain puzzle template game without doing anything to it, it launches on the android device just fine. However, after finally finishing my game, it doesn’t launch on the device anymore and the output log displays a lot of errors most notably:

LogPlayLevel: UnrealBuildTool: …/…/…/…/…/Users/UserName/Documents/Unreal Projects/TileBreaker/Source/TileBreaker/StaticPuzzleVectors.h(12,1) : error: ‘static’ is not permitted on a declaration of a type [-Werror,-Wmissing-declarations]


LogPlayLevel: UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: C:\Users\UserName\Documents\Unreal Projects\TileBreaker\Binaries\Android\TileBreaker-armv7-es2.so


LogPlayLevel: Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.CommandUtils+CommandFailedException: Command failed (Result:5): C:\Program Files\Epic Games\4.14\Engine\Binaries\DotNET\UnrealBuildTool.exe TileBreaker Android Development -Project=“C:\Users\UserName\Documents\Unreal Projects\TileBreaker\TileBreaker.uproject” “C:\Users\UserName\Documents\Unreal Projects\TileBreaker\TileBreaker.uproject” -remoteini=“C:\Users\UserName\Documents\Unreal Projects\TileBreaker” -noxge -NoHotReload -ignorejunk. See logfile for details: ‘UnrealBuildTool-2017.01.09-19.05.24.txt’


PackagingResults:Error: Error Launch failed! Unknown Error

I already tried deleting the Binaries/Intermediate/Saved folders and relaunching, GenerateVisualStudioFiles via UEProjectFile, installed all Android SDK, NDK Kit, Nvidia Tegra, CodeWorks, etc… Nothing worked! I badly need someone’s help.

Here’s the full log file [link text][2]

Loqz,

Remove the ‘static’ declaration from the files in the errors listed below. The error also states to update your API because it’s outdated. Are you able to package for Android using a blank template?

LogPlayLevel: UnrealBuildTool: ../../../../../Users//Documents/Unreal Projects/TileBreaker/Source/TileBreaker/StaticPuzzleVectors.h(12,1) :  error: 'static' is not permitted on a declaration of a type [-Werror,-Wmissing-declarations]
LogPlayLevel: UnrealBuildTool: static class TILEBREAKER_API StaticPuzzleVectors
LogPlayLevel: UnrealBuildTool: ^
LogPlayLevel: UnrealBuildTool: C:/Users//Documents/Unreal Projects/TileBreaker/Source/TileBreaker/Grid.cpp(62,85) :  warning: 'AudioComponent' is deprecated: AudioComponent should not be accessed directly, please use GetAudioComponent() function instead. AudioComponent will soon be private and your code will not compile. Please update your code to the 
new API before upgrading to the next release, otherwise your project will no longer compile. [-Wdeprecated-declarations]
LogPlayLevel: UnrealBuildTool:         (Cast<AMainPawn>(UGameplayStatics::GetPlayerPawn(GetWorld(), 0)))->AudioLevelPass->AudioComponent->Stop();
LogPlayLevel: UnrealBuildTool:                                                                                            ^
LogPlayLevel: UnrealBuildTool: C:\Program Files\Epic Games\4.14\Engine\Source\Runtime\Engine\Classes\Sound\AmbientSound.h(16,25) :  note: 'AudioComponent' has been explicitly marked deprecated here
LogPlayLevel: UnrealBuildTool:         class UAudioComponent* AudioComponent;
LogPlayLevel: UnrealBuildTool:                                ^
LogPlayLevel: UnrealBuildTool: In file included from C:/Users//Documents/Unreal Projects/TileBreaker/Source/TileBreaker/StaticPuzzleVectors.cpp:4:
LogPlayLevel: UnrealBuildTool: ../../../../../Users//Documents/Unreal Projects/TileBreaker/Source/TileBreaker/StaticPuzzleVectors.h(12,1) :  error: 'static' is not permitted on a declaration of a type [-Werror,-Wmissing-declarations]
LogPlayLevel: UnrealBuildTool: static class TILEBREAKER_API StaticPuzzleVectors
LogPlayLevel: UnrealBuildTool: ^

Thank you so much! Removing the ‘static’ keyword solved my problem. Now I know that you shouldn’t use static classes in android.

Btw, are the LogCook Warnings on Unparsable ini’s ok? Can I just leave them be? Because now that my game is finally launching in my android device, it doesn’t run similar to that in the computer. Some levels take forever to load, some audios do not play at all. Any ideas about this?

I’m glad removing ‘static’ resolved your issue for you. :smiley:

It’s ideal to have a clean output log however, warnings typically will not cause errors but if you do notice a problem with your game, try cleaning up what warnings you can in your project.