Download

Correct Setup for Android (which versions for JDK SDK NDK ANT?)

Hello, I have been trying for 3 weeks have been devoting all my time for the past 5 days to try and get a successful android build and am still failing.

What are the details for successfully building a project for Android?

Can someone who has successfully compiled

(On windows 7 ultimate x64) I have tried:
Changing the JDK to 1.7.xxx - several different ones (and 1.8 and 1.6). I have set the environment variables to the path where TADP installs as well as other places I have put the JDK.
Is there only a very specific combination of the Android NDK, SDK, ANT, and JDK that will work (what are they!? please tell me :’( … )?
All of my environment variables are correct.
I have set the minimum API to 19 (and 9 and 10 and … and 1000 for fun).
I have tried some different Android NDK, SDK, ANT
I have tried compiling empty projects and example projects.
I have tried compiling UE4 from source on github.
I have tried restarting, reinstalling, attempting to build while on Mars.
I have tried a thousand different configurations in the project settings.
I have tried the command line.
Some other things I forgot probably.

Questions:

Is there somewhere that has a list of everything you need to do to get it working (not just install TADP because that will lead to failure right away, the official UE4 documentation is lacking at best)?
Are there certain plugins that need to be disabled (something not obvious)?
Are other things in the TADP depreciated and need to be replaced (android ndk 9d, 10, 10b, 10c, 10d??, what version of the android sdk with which one of those will work; something from 19-24 and all the subversions)?
Can I point my environment variables to somewhere other than where the TADP installs things (obviously only if the needed software is there)?

Please help

I currently have 18 errors which begin with error: package R does not exist and refer to various things. This is just the latest set of errors from many different things (I do not have them all saved).

You could try the easy way. Use AndroidWorks instead of the TADP supplied with UE4. It is the successor to TADP. You will need to register with Nvidia to get access to AndroidWorks. But I installed it and let it download all its dependencies. Even though I have a separate android-sdk install.

AndroidWorks sets all the environment variables and integrates with visual studio. For me it was basically a one click operation to install and wait for all the huge downloads. Now Visual Studio compiles and it just works without any fiddling.

If you insist on TADP, the last time I had it working it gave me a lot of grief about environment variables. So just fix those and it should work.

1 Like

Thank you for responding.

I will try AndroidWorks. I have no attachment to TADP at all. I have tried fixing the environment variables several times and they are all correct but still no luck.

Hey Burnrate,

Pretty sure you have seen it but if not, have you tried the Android Getting Start guide? If that does not help can you please post any logs you get when things fail to package or if things just fail. Without a log it is rather hard to figure out what is going on. Finally total shot in the dark but sometimes the paths in the Android SDK version look like they are correct but they are not. Try manually editing each field by clicking on the three dots at the end of the input box. Then make sure that the path is correct by re-typing or copying and pasting the path and finally make sure that there is no blank space at the end of paths as that cause issues as well. Let us know if it worked or not.

Cheers-

Sam Deiter

Thanks for the ideas. I tried and still have the same problem. When building for android I get “error: package R does not exist” a bunch of times for different reasons.

When I try to build for windows in shipping configuration I always get the “Failed to open descriptor file” message which I have seen a lot of people talk about. Maybe it is related.

This will happen for any project; even the example projects. I am losing my mind not being able to build anything!

Thank you for the reply Sam. I have looked through that guide a few times.

I have attached the logs for trying to build the top down example project (its says .log files are not valid attachments so I just added the .txt). I haven’t changed a thing in it except to name the android package. The windows build succeeds but gives me the missing descriptor error. Maybe it is related? I have read “package R does not exist” for android may be related to incorrect information in the manifest xml.

These are the sdk config settings. Environment Variables are correct also.
9cbd4b94116e936bcd311a7a3f3734ad5f761d99.png

Let me know if there is any other info I can provide to shed some light on this.

Hi Burnrate,

The package R does not exist may be due to there being multiple copies of the OBB downloader files with different package names. The easiest way to fix this is to go into your project directory and delete Build/Android/src and Intermediate/Android, then repackage.

That worked!

Summary of changes for those who read this:

  1. Installed AndroidWorks instead of TADP; I have only VS express so it did not integrate with that but now I have working JDK, NDK, ADK, ANT.
  2. Deleted Build/Android/src and Intermediate/Android.

It builds and starts on the phone (but immediately crashes, That’s a whole different problem though). :slight_smile:

Its odd this would happen on the example project as well without changing things.

So now I have “BUILD SUCCESSFUL” for both Android and windows but Android crashes immediately on start and windows says it cannot find the descriptor file.

1 Like

Hi Burnrate,

Ok, for the Android crash the next step will be to get logs off the phone. You can either run monitor.bat in android-sdk-windows/tools or if you like command line, you can use “adb logcat”. “adb logcat -c” clears the log, “adb logcat” will show all log messages until you hit ctrl-c, and “adb logcat -s UE4” will only show UE4 log messages. You may see the cause of the problem with just the UE4 log messages followed by an assert, or you may need to look at all the messages to see the crash report.

Thank you.

Log file for monitor.bat failing to open attached.

Do i need to use the older JRE? Do I need to update ANT to 1.8.3? What configuration do you know that works for the versions of the sdk, ndk, jdk, ant?

I have previously had much success with intellij and libgdx and wanted to start crossing over into developing for both Android/PC then eventually PC. I wan’t the games to play outside of the viewport! The only thing I have actually had run was a build I made for HTML5, shouldn’t that be the most difficult thing to get working!?

Mixing versions of the tools and java doesn’t usually work. You may have a different java in your path it is finding. Try the adb logcat for now; it shouldn’t have a problem. You can catch the log messages to a file by redirecting it to a file “adb logcat >log.txt”. Wait a minute for it to capture everything and hit ctrl-c to stop it.

Hi Chris

I did
adb logcat -c
then tried to launch the game from the unreal engine and did
adb logcat -d > [filename]
I tried to do it so as not to get to much extra stuff.

Maybe its something simple. I may have to start over again because I went to far into development without being able to build and check things.

Can you link to a reference that discusses what parts of UE4 play well with android and what parts don’t?

Thanks for all the help!

My logcat slaps me in the face.

I had some stupid stuff in the play store setup (I had never gotten around to filling it out) that was actually causing it to crash and I disabled the play store support and it launched.

https://answers.unrealengine.com/questions/253779/cant-alpha-test-from-google-play.html

Have a look here, it doesn’t matter how you set it up. If you’re using 4.8 and google play services are enabled it will always crash after sign in

setup unreal sdk and jdk and ndk : https://youtu.be/QyXQ30N4h2Q

Sweet

you mean codeworks