x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Android Debugger - Doesn't Exist, Doesn't Connect & More

I've been trying pretty much all day to get the Android Debugger working with my nVidia Shield Device, but it absolutely refuses to work. What's annoying is that I'm now so close to getting there but it just doesn't seem to connect to the device. I'll start at the beginning:

  • Package Game for Windows, works and runs as expected on Desktop.

  • Package game for Android DXT - Attempt to run it on the nVidia shield tablet and get a crash instantly. The Android log in Visual Studio gives me no useful information. The problem is almost certainly caused by my code since that's the last log message that appears, but after that it's gone.

  • Originally had a newer version of the TDP installed, 4.0 or something, since I thought I had to have that to debug Shield devices.

  • Visual Studio had NO options for debugging on Android. See thread here: https://forums.unrealengine.com/showthread.php?81239-Seriously-HOW-do-you-attach-the-Debugger-to-an-Android-Device-!

  • Spent ages trying to fix that, had numerous issues as per the thread above. Decided to re-install the TADP but this time STRAIGHT from the engine folder (4.8), which I think is TADP version 2.0r or something.

  • I now have an 'Android Debugger' option in Visual Studio (Finally!) When I hit that, it deploys to & launches the game on the Shield device.

  • Now the problem is, my breakpoints in my code go white as if the symbols aren't being loaded or aren't available. Additionally, it looks as though the debugger never actually manages to connect to the device, since these are the entire contents of the output window: List item

  • I can cause the crash by opening a specific level, as soon as I open the level the debugger calls a breakpoint but NOT in my code, instead I get something called 'Segmentation Error'. The callstack gives me absolutely nothing, only vague memory addresses, but no functions or breakpoints that I can follow: alt text

So that's where I'm stuck. Honestly it's kind of depressing that there is literally, NO documentation on how to debug Android devices. Both myself an a chap with years of experience at EA have struggled to work through this, so I have no idea how the general population are meant to work through it...

So I figure that the Segmentation Error is down to the Game crashing and the debugger hasn't successfully attached, but I could be way off.

I really need to get this problem sorted fast, so if needs be I can send somebody a copy of the game providing it remains private?

Product Version: UE 4.8
Tags:
android.jpg (40.0 kB)
derp.jpg (260.2 kB)
more ▼

asked Aug 21 '15 at 03:46 PM in Using UE4

avatar image

TheJamsh
820 60 97 140

avatar image Chris Babcock STAFF Aug 21 '15 at 04:12 PM

AndroidWorks includes a new version of Nsight which works a lot better with UE4. We are including AndroidWorks installer with 4.9 instead of TADP now. This also includes the latest ndk (r10e), sdk, and build tools. There are changes in 4.9 to properly support these changes.

Since you are doing a code project, the easiest thing to do is first package your game and install it so the OBB is in place. Then, you can start the debugger with F5. You may see the SIGILL initially from libcrypto attempting to determine cpu features; this is normal. Either just continue or disable the exception in Debug->Exceptions->Android Exceptions.

avatar image TheJamsh Aug 24 '15 at 09:01 AM

Hi Chris, I just branched off and deployed using 4.9 (I can only do that through VS at the moment BTW, Packaging in 4.9 seems to be broken).

It seems to connect now, it starts the debugger and loads the game on the device. But the game immediately crashes and the log just says it 'exited normally'.

I tried dropping in a breakpoint in the GameInstance but even that didn't get triggered. It DID however turn red this time when the game loaded, whereas it used to stay white as if it wasn't active.

avatar image TheJamsh Aug 24 '15 at 09:04 AM

Here's the Log...link text

output.txt (3.8 kB)
avatar image TheJamsh Aug 24 '15 at 09:09 AM

Ahhh... Just checked the Android LogCat, and now I'm getting an 'Assertion Failed' in 'Generic Platform Memory.cpp' - Line 77.

It seems like the Engine Asserts aren't actually triggering any debug messages at all, or even any break points...

avatar image Chris Babcock STAFF Aug 25 '15 at 06:47 PM

The asserts aren't triggering breaks due to FAndroidMisc::IsDebuggerPresent() in AndroidMisc.cpp always returning false. You can change this to true and you should see the debugger stopping on the asserts.

avatar image spaceharry Aug 27 '15 at 12:31 AM

Sorry to hijack this here. I am also having trouble with the nsight debugger on my galaxy s4 here. Dont know how I should solve this withouth debugger: https://answers.unrealengine.com/questions/282539/galaxy-s4-black-screen-open.html#answer-291807

avatar image TheJamsh Aug 24 '15 at 11:48 AM

Just tried with the Unreal Flying Template, and I now get a different error. Against, looks like a Signal loss problem...

warning: .dynamic section for "C:\Users\JamesB\AppData\Local\Temp\Nsight_Tegra_devices\0424814604928001c499\symbols32\system\lib\libgnustl_shared.so" is not at the expected address (wrong library or version mismatch?)

Loaded 'libgnustl_shared.so' warning: Could not load shared library symbols for libvrapi.so. Do you need "set solib-search-path" or "set sysroot"? Loaded 'libvrapi.so' Loaded 'libstagefright_http_support.so' Loaded 'libeffects.so' Loaded 'libwilhelm.so' Loaded 'libOpenSLES.so' Loaded 'libUE4.so' Program exited because of signal SIGSEGV (Segmentation fault) The program '[9413] com.YourCompany.FlyingTemp' has exited with code 0 (0x0).

avatar image Shadowriver Aug 21 '15 at 04:15 PM

Segmentation Fault in Unix standards (since Android runs on Linux) is what Access Violation is for Windows, it's invalid memory access. And it really look like it GDB gives wrong information to VS. You sure you build your Android application in debug build (not devlopment)? because in unix-like compilers debug symbols are included in binary, but still only 3 calls in stack is little small for UE4.

avatar image Chris Babcock STAFF Aug 21 '15 at 04:17 PM

Yes, definitely set configuration to Debug and platform to Android (or Tegra-Android.. Nsight sometimes changes the vcxproj).

avatar image TheJamsh Aug 21 '15 at 04:21 PM

Thanks Guys.

I have done both those things. I build the game in-engine for DebugGame, and deployed it to the device like I usually do then tried running the debugger, still no luck.

I also tweaked a few settings in the Project as well. Under the Android tab I checked 'Include Debug Symbols in Package' etc, and a few other things that looks a bit suspect.

I just find it weird that the debugger doesn't seem to even connect to the Shield device. Glad to hear of the improvements coming in 4.9. We're looking at having Push Notifications as well which I think are coming in 4.9. Is this stuff in the Preview builds? Perhaps it's worth us grabbing that and seeing how we get on. This build itself is massively experimental anyway.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question