Mac Android -Djava.source=1.7 -Djava.target=1.7'

Packaging for Android ends up in an error:

Program.Main: ERROR: AutomationTool terminated with exception: ERROR: /bin/sh failed with args -c ‘"/Users/lorisbonauer/ NVPACK/apache-ant-1.8.2/bin/ant" debug -Djava.source=1.7 -Djava.target=1.7’

[Outputlog.pdf][2]

I followed the Android Quick start documentation strictly.

My Android SDK settings looks like this:

I have already tried to replace the SDK API Level with “matchndk”
and I replaced the NDK API Level with every possible Version.

Thank you very much for any response!

It is indeed very frustrating…

Any Ideas?

Update:
Tried it on a new Mac and made sure that I run the newest Version of Java and followed strictly the Documentation.
Still getting the same Error:

Program.Main: ERROR: AutomationTool terminated with exception: ERROR: /bin/sh failed with args -c ‘"/Users/lorisbonauer/ NVPACK/apache-ant-1.8.2/bin/ant" debug -Djava.source=1.7 -Djava.target=1.7’

I have same issue in Windows. and Engine version 4.17.2

Did you solve this problem?

Well I have kind of solved it…
I have tried it in another Project and still got the error. Then I updated it to 4.18 Preview and it worked. Strangely it works now also in 4.17.2
So try to update…

But the Project I want to pack does not work at all but I have the feeling that it has to do with my Plugin: “Universal Mobile Ads” which isn’t 4.18 compatible yet.
When it is released I give that a shot and let you know

Ironically
In the other Project I can’t pack for IOS anymore.
Now I have one game already on the App Store and another one only on my Samsung device…

Thank you for your message.
I solve this issue. I use plugin that name is GoogleAnalytics.

Have you updated Android SDK using SDK Manager?
like Android SDK Tools, Android SDK Platform-tools, Android SDKBuild-tools, Android Support Repository.

Epic staff said.
We shouldn’t have updated android tools and etc using SDK Manager.
https://forums.unrealengine.com/development-discussion/android-development/114904-invalid-or-unsupported-command

I reinstalled androidworks 1R6u1.
And I changed UPL_Android.xml of plugin file.

(Gradle dependencies, Maven AARImports library version)

Because this plugin want to insert higher play services library version.
so I down the version. like 11.0.4 → 9.8.0.

I dont’ know Universal Mobile Ads use like this code.

Thank you.
I hope your project build well.

Thank you for your answer!
Actually the Error “-Djava.source=1.7 -Djava.target=1.7’” shows up when I try to package for distribution. When I package it for development, everything works fine.
Sorry that I missed that…
So the plugin shouldn’t be the problem.

I am afraid of reinstalling everything because I finally got it “worked” after many failures to Launch it on my Device.

But it seems like the only Option
Thank you for replying even though you already have fixed your Problem!!
Very Kindly