Sysprogs forums › Forums › VisualGDB › BUILD FAILED
- This topic has 13 replies, 2 voices, and was last updated 12 years ago by support.
-
AuthorPosts
-
October 27, 2012 at 03:48 #526John GabyParticipant
I am evaluating this tool and I am really hoping that it will make debugging native code easier. I have used your tutorial to compile and debug the sample ‘Hello Jni’ app. I then decided to bite the bullet and see what it can do with one of my apps. At first I did succeed in getting it to compile and run, however the breakpoints did not seem to work. I then did a ‘Build/Rebuild Solution’ and now I get the following error:
Build started: Project: AndroidApp2, Configuration: Debug Win32
Performing Makefile project actions
c:android-ndkndk-build.cmd NDK_DEBUG=1 APP_PLATFORM=android-9
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Install : libhexlogic-jni.so => libs/armeabi/libhexlogic-jni.so
VisualGDB: Installed an updated gdbserver to D:GabySoftGCodeHexLogicAndroidlibsarmeabigdbserver
c:apache-ant-1.8.4binant.bat debug
BUILD FAILED
D:GabySoftGCodeHexLogicAndroidbuild.xml:46: taskdef class com.android.ant.SetupTask cannot be found
using the classloader AntClassLoader[]
Buildfile: D:GabySoftGCodeHexLogicAndroidbuild.xml
Total time: 0 seconds
Build log was saved at “file://c:AndroidProjectsAndroidApp2AndroidApp2DebugBuildLog.htm”
AndroidApp2 – 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========Any ideas?
Thanks.
October 27, 2012 at 09:23 #2280supportKeymasterHi,
The build problem is caused by the ANDROID_SDK_ROOT environment variable. Please go to System Settings, Environment Variables and set a new Environment Variable for the current user:
Name: ANDROID_SDK_ROOT
Value: directory where you have installed Android SDKNote that VisualGDB 2.8 will provide ANDROID_SDK_ROOT automatically and won’t require this trick any more.
Regarding the breakpoints, there are numerous breakpoint bugs in ndk-gdb and VisualGDB provides workarounds for most of them. If it does not work in your case, please do the following:
1. Open VisualGDB Project Properties (right-click on the project in Solution Explorer).
2. Go to GDB Settings tab.
3. Check the “Log all interaction with GDB” checkbox.
4. Start debugging. Try setting breakpoints.
5. In the GDB Session window run the following commands:info shared sharedlibrary
6. Try setting your breakpoints again.
7. Exit debug session.Then please send all .log files from your project directory to support@sysprogs.com so that we can diagnose your problem further.
October 27, 2012 at 15:00 #2281John GabyParticipantThat does not seem to help. The following is a screen shot of the environment variable I added:
The following is the result of a ‘Rebuild Solution’:
Rebuild All started: Project: AndroidApp2, Configuration: Debug Win32
Performing Makefile project actions
c:android-ndkndk-build.cmd NDK_DEBUG=1 APP_PLATFORM=android-9 clean
Clean: hexlogic-jni [armeabi]
Clean: stdc++ [armeabi]
c:apache-ant-1.8.4binant.bat clean
BUILD FAILED
D:GabySoftGCodeHexLogicAndroidbuild.xml:46: taskdef class com.android.ant.SetupTask cannot be found
using the classloader AntClassLoader[]
Buildfile: D:GabySoftGCodeHexLogicAndroidbuild.xml
Total time: 0 seconds
VisualGDB: deleting D:GabySoftGCodeHexLogicAndroidbin and all its contents.
VisualGDB: deleting D:GabySoftGCodeHexLogicAndroidlibs and all its contents.
VisualGDB: deleting D:GabySoftGCodeHexLogicAndroidobj and all its contents.
c:android-ndkndk-build.cmd NDK_DEBUG=1 APP_PLATFORM=android-9
In file included from D:/GabySoft/GCode/HexLogic/Android//jni/../../../Android/cpp/GStream.cpp:1:0:
c:android-ndkplatformsandroid-9arch-armusrincludejni.h(592,13): note: the mangling of ‘va_list’ has changed in GCC 4.4
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
“Compile thumb : hexlogic-jni <= hexlogic-jni.c
“Compile++ thumb : hexlogic-jni <= GStream.cpp
In file included from D:/GabySoft/GCode/HexLogic/Android//jni/../../../Android/cpp/GSystem.cpp:1:0:
c:android-ndkplatformsandroid-9arch-armusrincludejni.h(592,13): note: the mangling of ‘va_list’ has changed in GCC 4.4
“Compile++ thumb : hexlogic-jni <= GSystem.cpp
“Compile++ thumb : hexlogic-jni <= GWindow.cpp
In file included from D:/GabySoft/GCode/HexLogic/Android//jni/../../../Android/cpp/GWindow.cpp:1:0:
c:android-ndkplatformsandroid-9arch-armusrincludejni.h(592,13): note: the mangling of ‘va_list’ has changed in GCC 4.4
“Compile++ thumb : hexlogic-jni <= GUtil.cpp
“Compile++ thumb : hexlogic-jni <= GXml.cpp
“Compile++ thumb : hexlogic-jni <= GConfig.cpp
“Compile++ thumb : hexlogic-jni <= GJson.cpp
“Compile++ thumb : hexlogic-jni <= GMemStream.cpp
“Compile++ thumb : hexlogic-jni <= GStyle.cpp
“Compile++ thumb : hexlogic-jni <= HexLogicApp.cpp
StaticLibrary : libstdc++.a
SharedLibrary : libhexlogic-jni.so
Install : libhexlogic-jni.so => libs/armeabi/libhexlogic-jni.so
VisualGDB: Installed an updated gdbserver to D:GabySoftGCodeHexLogicAndroidlibsarmeabigdbserver
c:apache-ant-1.8.4binant.bat debug
Buildfile: D:GabySoftGCodeHexLogicAndroidbuild.xml
BUILD FAILED
D:GabySoftGCodeHexLogicAndroidbuild.xml:46: taskdef class com.android.ant.SetupTask cannot be found
using the classloader AntClassLoader[]
Total time: 0 seconds
Build log was saved at “file://c:AndroidProjectsAndroidApp2AndroidApp2DebugBuildLog.htm”
AndroidApp2 – 0 error(s), 0 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========Thanks
October 27, 2012 at 15:03 #2282John GabyParticipantI also want to reiterate that the very FIRST time I built this project, I did NOT get any errors (even without ANDROID_SKD_ROOT being set) and I WAS able to run the project successfully (although I didn’t get the breakpoints to work).
Thanks.
October 28, 2012 at 09:51 #2283supportKeymasterHi,
After setting the environment variable you need to restart Visual Studio (or better restart your computer) to get the environment variable propagated.
The problem seems to be quite common for Android SDK (e.g. see here: http://blog.klacansky.com/matter-code/ant-taskdef-class-com-android-ant-setuptask-cannot-be-found).
Could you please attach the D:GabySoftGCodeHexLogicAndroidbuild.xml file here?October 28, 2012 at 15:21 #2284John GabyParticipantI rebooted the machine but still no luck. I am still getting the same error as before. To double check the setting of ANDROID_SDK_ROOT I opened a command prompt and typed:
dir %ANDROID_SDK_ROOT%
and it displayed the correct directory.
Thanks
October 28, 2012 at 16:36 #2285supportKeymasterStrange. Please attach your build.xml file here or send it to support@sysprogs.com so that we can try to reproduce your problem.
October 29, 2012 at 00:54 #2286John GabyParticipantHere is the ‘build.xml’ file from the root directory of the project. Is this what you wanted? Note that I am still able to build and run this project using Eclipse.
classname=”com.android.ant.SetupTask”
classpathref=”android.antlibs” />
October 29, 2012 at 09:31 #2287supportKeymasterHi,
Building from Eclipse works, as Eclipse uses a separate eclipse-specific build system plugin, while VisualGDB relies on Apache ANT (official command-line build tool for Android).
Looks like your build.xml file is either generated by an old version of Android SDK or has been replaced by some other tool.
Please try deleting it and rebuilding the project. VisualGDB should rebuild the build.xml file automatically.If the problem persists, please attach the log of the first build (after deleting build.xml) and specify your Android SDK version.
You can also try deleting/renaming the build.properties file.
October 29, 2012 at 14:56 #2288John GabyParticipantThat fixes the problem, thanks.
I now have it running and this time was able to stop on a breakpoint. However, it is very slow and unresponsive and the ‘GDB command Timeout’ dialog keeps popping up. Also, sometimes when I try to continue I get an error that tells me ‘The debugger cannot continue running the process’. I must confess, however, that I am testing this on a virtual machine using the Android emulator. I am going to have to try this now on my actual build machine with a real device. I can tell you, however, that if I can get this to work, it will be a pretty sweet tool and well worth the money.
Thanks for your help.
October 29, 2012 at 15:17 #2289supportKeymasterHi,
The Android emulator is the answer here. It is unbelievably slow compared to the actual Android devices. However, note that you would need an actual Windows machine (not a VM) to debug a physical phone or a tablet, as the Android USB driver does not work well with VirtualBox/VMWare.
October 29, 2012 at 16:11 #2290John GabyParticipantI do realize that, I have been working on Android for a long time, in fact, I have been able to get source code debugging of native code working with Eclipse in the past. However it has always been flakey and with the most recent set of tools I don’t seem to be able to get it to work at all anymore. This is why I am looking at your tool.
I did my initial testing using a virtual machine because I didn’t want you stuff to mess up my build machine. I am now confident enough that that won’t happen and am going to try it out on my build machine with a real device. As I said, if I can get this to work well, it will be well worth the money.
Thanks.
By the way saying the the emulator is ‘unbelievably slow’ is actually quite charitable. It is slow to the point of ALMOST being unusable.
October 29, 2012 at 19:42 #2291John GabyParticipantOk, I now have it running on actual hardware and I must say it looks pretty sweet. I am going to need to play with it a bit more, but it looks like you guys deserve a nice kudos.
I have one more questions and a small snivel.
1) Is it possible to debug both the native and java sides at the same time, and if so how do I do that?
2) When I import a project it does not appear to be reading the Android.mk file and picking up all of the c and cpp source files. The only one it adds is the basic xxx-jni.c file. I have to add the rest manually. This is not a major deal, but I do have a fair number of projects to import and it would have been nice if it just worked.
Thanks.
October 29, 2012 at 21:35 #2292supportKeymasterHi,
1) Sure. Here’s a tutorial how to do that: http://visualgdb.com/tutorials/android/codebug/
2) Unfortunately, the current version only imports the files from the project directory. Thanks for your feedback, we have put this feature request to the v2.8 plan. -
AuthorPosts
- You must be logged in to reply to this topic.