Android Support Repository license BUG

Hi,

I’ve been trying to package a basic Gear VR app using UE4.18 with no luck using both shipping and distribution builds under Grade and ANT. The only thing that worked insofar is ANT on a development packaging.
I’ve installed the sdk and other tools from the provided resources from the UE4 installer and accepted the license there and via the project settings. I get this error when performing the final .apk:

File C:\Users------.android\repositories.cfg could not be loaded.
UATHelper: Packaging (Android (ASTC)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (ASTC)): * What went wrong:
UATHelper: Packaging (Android (ASTC)): A problem occurred configuring project ‘:app’.
UATHelper: Packaging (Android (ASTC)): > Could not resolve all dependencies for configuration ‘:app:_debugApk’.
UATHelper: Packaging (Android (ASTC)): > A problem occurred configuring project ‘:permission_library’.
UATHelper: Packaging (Android (ASTC)): > You have not accepted the license agreements of the following SDK components:
UATHelper: Packaging (Android (ASTC)): [Android Support Repository].

I think it’s something to do with the way the Android Support Repository gets distributed as per:

Note that I’m missing an repositories.cfg file in my Users documents so I think the licensing issue is a false error there.

Regarding packaging with ANT, shows a bunch of warnings similar to this report:

As a final note, I’ve been packaging apps for Gear for half a dozen UE4 versions now and I’m getting these errors on stock, empty projects.
Any help is much appreciated.

I was able to solve this issue using a solution from another similar question:

  1. Downloaded Android Studio

  2. Installed Android Studio. It found the folder with the Android SDK installed, I did not change it.

  3. Removed the license from / android-sdk-windows / licenses.

  4. Accepted the license in UE4 again.

This is from a comment on this page: https://answers.unrealengine.com/questions/718698/accept-the-license-agreements.html