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"

Can't attach MVS 2015 debugger to Android device

Hi everyone, I followed the "Set up Android" steps from the documentation, using the version of AndroidWorks that ships with the engine but I can´t seem to be able to debug the application once it´s launched on my Android phone . Here are the steps I take to deploy my C++-based game to the device:

  • Visual Studio: Build configuration DebugGame Editor - Win64

  • Run the UE4 editor

  • UE4 editor: Package the game using File > Package > Android

  • Install the game in my Android Device

  • Activate the Wait for Debugger to attach option with the matching game

  • Visual Studio: Kill the UE4 editor with the "stop debugging" button.

  • Visual Studio: Build configuration DebugGame Editor - Android

  • Select Debug -> Step Into. (VS prompts again for out of date build, choosing to rebuild or not has no effect on the result)

  • Tegra for Visual Studio startup dialog does not appear and it simply does nothing

  • I go into Debug->Attach to Process and choose:

  • Transport: Nsight Tegra.

  • Qualifier: Oneplus.

  • Process: com.example.game

  • Tegra for Visual Studio just gives me an error indicating it can´t connect

I have tried to connect to My Oneplus X but it seems impossible.

Please do help me a little bit with this.

Product Version: UE 4.10
Tags:
more ▼

asked May 17 '16 at 07:47 AM in C++ Programming

avatar image

WolfAlvein
23 14 17 22

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

1 answer: sort voted first

Hello WolfAlvein,

Visual Studio 2015 does not currently have the capability to debug for Android at this time. If you wish to debug Android projects, you'll need to use Visual Studio 2013. We do currently have plans to add 2015 support for this which is in our system under the number UEPLAT-266.

Also to use 2013, if you aren't already, you'll need to use a version of the engine built from source. You can find more information about another user's experience attempting to use this as well here: https://forums.unrealengine.com/showthread.php?98878-How-do-we-re-enable-Android-Debugging-in-4-10

more ▼

answered May 17 '16 at 07:20 PM

avatar image theonecalledtom Sep 28 '17 at 05:28 PM

Is this still the case? Everything looks good in VS2015 except the GDB server startup.alt text

I can log but debugging is gonna be a sloooow process this way! :)

gdbstartup.jpg (26.7 kB)
avatar image Matthew J Sep 28 '17 at 08:37 PM

Hello theonecalledtom,

I haven't been able to get it to work myself, but I am told that VS2017's Microsoft Debugger can be used if you include the -vsdebugandroid command in your GenerateProjectFiles.bat. What device are you trying to debug, and are you trying to debug CPU or GPU?

avatar image theonecalledtom Sep 28 '17 at 08:59 PM

Hi Matthew, Thanks for your response.

I'm trying to debug the CPU on a Pixel XL. Looks like 99% or my code is behaving as expected on Android but getting the last 1% working using logging only will be painful. Guess I'll try VS 2017.

avatar image theonecalledtom Sep 29 '17 at 03:56 AM

Now getting the following error when I try to run / build the DebugGame Android sku:

33>PLATFORM_ANDROID_NDK_VERSION = 120200 33>NDK toolchain: r12b, NDK version: 24, GccVersion: 4.9, ClangVersion: 3.8.256229 33>Compiling Native code with NDK API 'android-24' 33>EXEC : error : System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r12b\sources\android\cpufeatures\cpu-features-patched.c' is denied. 33> at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

File doesn't exist afaik - there is a cpu_features.c file. So perhaps I'm missing some followup patch on the original installation.

avatar image theonecalledtom Sep 29 '17 at 06:39 PM

That was just a matter of setting permissions on the folder, followed by another one (Program Files (x86)\Microsoft Visual Studio\2017\Community\Apps\apache-ant-1.9.3\bin).

Still missing something though - I can build the android debug build but don't have any device options. Perhaps need to reinstall tegra or something to get working in VS2017?

avatar image theonecalledtom Sep 30 '17 at 04:13 PM

A reinstall of tegra nsight didn't help - looking at their documentation I don't see VS2017 on the supported version list. Also - looking at the VS2017 Android overview they talk about debugging the ARM platform which is not present in UE4 (Android). I guess the ARM settings would need to be transposed to Android.

avatar image Matthew J Nov 17 '17 at 06:16 PM

Hello theonecalledtom,

I apologize for the delay but are you still experiencing this issue? If so, please let me know and I'll attempt to continue investigating this issue. In the meantime, I'll be marking this issue as resolved for tracking purposes.

avatar image theonecalledtom Nov 17 '17 at 06:19 PM

Never did get debugging - using output to diagnose problems and it's a bit painful. I'm still on 4.17 fwiw.

A set of official instructions on how to debug C++ on an Android device would be golden!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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