DonFrag
(DonFrag)
June 8, 2017, 12:14pm
1
Hi. I am trying to implement admob and google play. So i try to follow the steps here
But when i make the step of modify Target.cs when i rebuild the project it fails because it says that
if (Target.Platform == UnrealTargetPlatform.Android)
{
ModuleNames.Add(“OnlineSubsystemGooglePlay”);
ModuleNames.Add(“OnlineSubsystem”);
ModuleNames.Add(“AndroidAdvertising”);
}
Is deprecated.
With other services like achievments leaderboards fails because the same reasons.
I have been looking for alternatives and most links ends here
I tried this and ended up reinstalling ue4.16 because the modification of the engine files corrupted any build that i make.
Is there any updated advice of d how to fix this?
Try this (from Ue4Game.Build.cs):
DynamicallyLoadedModuleNames.Add(“AndroidAdvertising”);
DonFrag
(DonFrag)
June 9, 2017, 1:04am
4
ok i fixed the error using this thread.
https://forums.unrealengine.com/showthread.php?145757-C-4-16-Transition-Guide
now when i am going to try using Google play services using your answer i get this
Running C:/Program Files/Epic Games/UE_4.16/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“D:/Projects/Mobile/MoleMole_Andres/MoleMole.uproject” -game -rocket -progress
Discovering modules, targets and source code for project…
Messages while compiling D:\Projects\Mobile\MoleMole_Andres\Intermediate\Build\BuildRules\MoleMoleModuleRules.dll:
d:\Projects\Mobile\MoleMole_Andres\Source\MoleMole\MoleMole.Build.cs(7,9) : warning CS0618: ‘UnrealBuildTool.ModuleRules.ModuleRules()’ is obsolete: ‘Please change your module constructor to take a ReadOnlyTargetRules parameter, and pass it to the base class constructor (eg. “MyModuleRules(ReadOnlyTargetRules Target) : base(Target)”).’
d:\Projects\Mobile\MoleMole_Andres\Source\MoleMole.Target.cs(14,9) : error CS0103: The name ‘DynamicallyLoadedModuleNames’ does not exist in the current context
UnrealBuildTool Exception: ERROR: UnrealBuildTool encountered an error while compiling source files
DonFrag
(DonFrag)
June 9, 2017, 1:43am
5
ok i got admob ad working with this
public class MoleMoleTarget : TargetRules
{
public MoleMoleTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
ExtraModuleNames.Add("MoleMole");
if (Target.Platform == UnrealTargetPlatform.Android)
{
ExtraModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "OnlineSubsystem" });
ExtraModuleNames.Add("OnlineSubsystemGooglePlay");
ExtraModuleNames.Add("OnlineSubsystem");
ExtraModuleNames.Add("AndroidAdvertising");
}
}
}
m1n1
(m1n1)
July 10, 2017, 5:56pm
6
Hello DonFrag, sorry for resurfacing this old thread, but I am too having trouble getting Admob and Google Play Services to run on 4.16.
I tried DynamicallyModuleNames.Add in Build.cs, which compiles fine, but nothing is showing when running my game.
Did you only modify your target.cs with the above code, or also your Build.cs?