Download

Building with Gradle error

Hey,
So I’ve made an empty project and added 3 plugins to it : Gamesparks, Appodeal( an ad mediator ) and MultiDex from the marketplace because the project had too many methods. Now i’ve been trying to make this work for a while and fixed bugs along the way that were preventing it from building but now i’m at an impass. This is the error I get :



AndroidManifest.xml:40:5-118 Warning:

UATHelper: Packaging (Android (ETC1)):     Element meta-data#com.google.android.gms.version at AndroidManifest.xml:40:5-118 duplicated with element declared at AndroidManifest.xml:24:5-118

UATHelper: Packaging (Android (ETC1)): Z:\app\src\main\AndroidManifest.xml:41:5-229 Error:

UATHelper: Packaging (Android (ETC1)):     Element activity#com.google.android.gms.ads.AdActivity at AndroidManifest.xml:41:5-229 duplicated with element declared at AndroidManifest.xml:25:5-180

UATHelper: Packaging (Android (ETC1)): Z:\app\src\main\AndroidManifest.xml Error:

UATHelper: Packaging (Android (ETC1)):     Validation failed, exiting

UATHelper: Packaging (Android (ETC1)): See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

UATHelper: Packaging (Android (ETC1)): :app:processDebugManifest FAILED

UATHelper: Packaging (Android (ETC1)): FAILURE: Build failed with an exception.

UATHelper: Packaging (Android (ETC1)): * What went wrong:

UATHelper: Packaging (Android (ETC1)): Execution failed for task ':app:processDebugManifest'.

UATHelper: Packaging (Android (ETC1)): > Manifest merger failed with multiple errors, see logs

UATHelper: Packaging (Android (ETC1)): * Try:

UATHelper: Packaging (Android (ETC1)): Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

UATHelper: Packaging (Android (ETC1)): BUILD FAILED

UATHelper: Packaging (Android (ETC1)): Total time: 27.831 secs

UATHelper: Packaging (Android (ETC1)): Picked up _JAVA_OPTIONS: -Xmx2048m -Xms256m -Xss8m

UATHelper: Packaging (Android (ETC1)): AndroidPlatform.GetAaptPath: Using this aapt: F:/AndroidSDK/android-sdk-windows\build-tools\24.0.2\aapt.exe

UATHelper: Packaging (Android (ETC1)): W/asset   (  704): Asset path F:\Unreal Projects\MobileStarterKit\Binaries/Android\MobileStarterKit-armv7-es2.apk is neither a directory nor file (type=1).

UATHelper: Packaging (Android (ETC1)): ERROR: dump failed because assets could not be loaded

UATHelper: Packaging (Android (ETC1)): Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.AutomationException: Failed to get package name from F:\Unreal Projects\MobileStarterKit\Binaries/Android\MobileStarterKit-armv7-es2.apk

UATHelper: Packaging (Android (ETC1)):    at AndroidPlatform.GetFinalObbName(String ApkName)

UATHelper: Packaging (Android (ETC1)):    at AndroidPlatform.GetDeviceObbName(String ApkName)

UATHelper: Packaging (Android (ETC1)):    at AndroidPlatform.Package(ProjectParams Params, DeploymentContext SC, Int32 WorkingCL)

UATHelper: Packaging (Android (ETC1)):    at Project.Package(ProjectParams Params, Int32 WorkingCL)

UATHelper: Packaging (Android (ETC1)):    at BuildCookRun.DoBuildCookRun(ProjectParams Params)

UATHelper: Packaging (Android (ETC1)):    at BuildCookRun.ExecuteBuild()

UATHelper: Packaging (Android (ETC1)):    at AutomationTool.BuildCommand.Execute()

UATHelper: Packaging (Android (ETC1)):    at AutomationTool.Automation.Execute(List`1 CommandsToExecute, Dictionary`2 Commands)

UATHelper: Packaging (Android (ETC1)):    at AutomationTool.Automation.Process(String] Arguments)

UATHelper: Packaging (Android (ETC1)):    at AutomationTool.Program.MainProc(Object Param)

UATHelper: Packaging (Android (ETC1)):    at AutomationTool.InternalUtils.RunSingleInstance(Func`2 Main, Object Param)

UATHelper: Packaging (Android (ETC1)):    at AutomationTool.Program.Main()

UATHelper: Packaging (Android (ETC1)): Program.Main: AutomationTool exiting with ExitCode=51 (Error_FailureGettingPackageInfo)

UATHelper: Packaging (Android (ETC1)): BUILD FAILED

PackagingResults: Error: Failed to get package info from APK file

Now I think I get that there is an issue with those 2 manifest files but my problem is that I have no idea where to find them since the intermediate folder is such a mess. Any tips here?

Full log can be found here if interested :

Looks at the AndroidManifest.xml in Intermediate/Android/APK/gradle/app/main/src/main. Also, looks like the clean failed because the path length is too deep.

Hey,
Thanks for the help. I did find the guilty manifest and it turned out there were some duplicate entries for some reason. Removed them and works now!

got the same problem, open the license file in android sdk with notepad, it should have only a key like this 8933bad161af4178b1185d1a37fbf41ea5269c55, but when you accept the sdk license it puts a white line before and have error.
just remove the white line