Unable to deploy project to Android device

Hi,

So, I downloaded UE4 just a a few days ago, and I was following the quick start guide to setup everything for developing on Android. I get to the step where I have to deploy my project to my phone (Note8, just in case it matters) and the editor crashed, I reported and restarted the project and it crashed again.

Then, I found the project launcher and tried to launch with it but it failed with the following error:

Observed package id 'build-tools;25.0.3' in inconsistent location 'C:\NVPACK\android-sdk-windows\build-tools\android-7.1.1' (Expected 'C:\NVPACK\android-sdk-windows\build-tools\25.0.3')
Observed package id 'system-images;android-20;android-wear;armeabi-v7a' in inconsistent location 'C:\NVPACK\android-sdk-windows\system-images\android-20\default\armeabi-v7a' (Expected 'C:\NVPACK\android-sdk-windows\system-images\android-20\android-wear\armeabi-v7a')
Observed package id 'system-images;android-20;android-wear;x86' in inconsistent location 'C:\NVPACK\android-sdk-windows\system-images\android-20\default\x86' (Expected 'C:\NVPACK\android-sdk-windows\system-images\android-20\android-wear\x86')
Observed package id 'build-tools;25.0.3' in inconsistent location 'C:\NVPACK\android-sdk-windows\build-tools\android-7.1.1' (Expected 'C:\NVPACK\android-sdk-windows\build-tools\25.0.3')
Observed package id 'system-images;android-20;android-wear;armeabi-v7a' in inconsistent location 'C:\NVPACK\android-sdk-windows\system-images\android-20\default\armeabi-v7a' (Expected 'C:\NVPACK\android-sdk-windows\system-images\android-20\android-wear\armeabi-v7a')
Observed package id 'system-images;android-20;android-wear;x86' in inconsistent location 'C:\NVPACK\android-sdk-windows\system-images\android-20\default\x86' (Expected 'C:\NVPACK\android-sdk-windows\system-images\android-20\android-wear\x86')
Incremental java compilation is an incubating feature.
Observed package id 'build-tools;25.0.3' in inconsistent location 'C:\NVPACK\android-sdk-windows\build-tools\android-7.1.1' (Expected 'C:\NVPACK\android-sdk-windows\build-tools\25.0.3')
Observed package id 'system-images;android-20;android-wear;armeabi-v7a' in inconsistent location 'C:\NVPACK\android-sdk-windows\system-images\android-20\default\armeabi-v7a' (Expected 'C:\NVPACK\android-sdk-windows\system-images\android-20\android-wear\armeabi-v7a')
Observed package id 'system-images;android-20;android-wear;x86' in inconsistent location 'C:\NVPACK\android-sdk-windows\system-images\android-20\default\x86' (Expected 'C:\NVPACK\android-sdk-windows\system-images\android-20\android-wear\x86')
File C:\Users\...\.android\repositories.cfg could not be loaded.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':permission_library'.
      > You have not accepted the license agreements of the following SDK components:
[Android Support Repository].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 11 mins 15.171 secs
ERROR: cmd.exe failed with args /c "D:\Fouad\Documents\Unreal Projects\AndroidProject2\Intermediate/Android/APK\gradle\rungradle.bat" :app:assembleDebug
       (see C:\Users\...\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.18\UAT_Log.txt for full exception trace)
AutomationTool exiting with ExitCode=1 (Error_Unknown)
BUILD FAILED

I’ve tried everything I can to get past this error, I tried building with Ant instead of Gradle, Failed, but I don’t have the error log for that unfortunately.

I tried updating the tools, build tools, platform tools and the Android Support Repository, but nothing solved the problem, and all this, including updating the repository, never created the “repositories.cfg” file.

I had Android Studio installed on my system and I had to reinstall it just so it would update the repository, but that did not work either.

So, now I’m stuck.

Currently, I’ve uninstalled Android Studio, CodeWorks and UE 4.18 and deleted anything that has to do with Andriod from my computer, I’m installing UE 4.17 to see if that might solve the issue, but I doubt that will solve the issue. As it seems to be an issue with CodeWorks and not UE.

Also, Can I use any version of CodeWorks that is older than 1R6 with UE 4.18 or 4.17?

Any help would be appreciated :slight_smile:
Thanks

Did you check you environment variables?
I had a similar problem when I installed Android Studio after CodeWorks.

What I did in that time was to uninstall everything. Install CodeWorks from the engine/extra folder, than delete your projects folders: Binaries, Intermediate, Saved and DerivedDataCache. Try to build.

Make sure you accepted the Android SDK agreement in your Project Settings/Android and specified the right tools path in your Project Settings/ Android SDK

Good luck :slight_smile:

I check all variables,but " ERROR: cmd.exe failed with args /c “\AndroidProject2\Intermediate/Android/APK\gradle\rungradle.bat” :app:assembleDebug",failed too
help plz,thanks

Not Use Gradle,succeed…

I check all variables,but " ERROR: cmd.exe failed with args /c “\AndroidProject2\Intermediate/Android/APK\gradle\rungradle.bat” :app:assembleDebug",failed too help plz,thank same error bro

Try unchecking the “Enable Gradle instead of Ant” checkbox in Project Settings (Platforms - Android)