NativeActivity VS2012 crash on fresh project with Shield K1

Hello,

I’m currently setting up Visual Studio with NSight to start doing work on my nVidia K1 Shield tablet. I’m trying to do a non java code project using only what comes with NativeActivity.

There is a project template for this that comes with NSight with example code already setup. An attempt to run this unaltered code causes the application to crash on the tablet immediately after the debuggers attach. Similarly trying to launch the deployed app causes it to crash.

I am new to Nsight and I’m doing this work to bring my Android Studio project over to Visual Studio.

Has anyone created a new project with this template and been able to figure out what is causing this app to crash on launch? Or maybe can point me to where in visual studio I should be looking for the type of settings I’m use to finding on Gradle?

Hi Cruxics,
For crash issue, what is the version of Nsight Tegra Visual studio? Could you send me the log from “%APPDATA%\NVIDIA Corporation\Nsight Tegra\Logs\log.txt”?

For Gradle setting, you can set it via Project Properties>General>Android Build System.

Victor

"Nsight Tegra Visual studio? "
3.3.15329.2064

Though looks like there is a 5.1.0 rC1 build on site.

I sent my log to you.

Hi Cruxics,
5.1.10 RC1 build you see is Nsight Visual studio not Nsight Tegra Visual. You can skip it.
From your log, it seems not complete to include crash error info.
Could you try it again by disable Fast Deploy via Project Properties>Deployment>Fast Deploy?
If it is still occurring, Please help me answer the following dummy questions to figure out what’s wrong.

  1. What android version do you use? You can get it by “adb shell getprop |grep build”.
  2. Which Step is the crash at? On launching dialog, There are 6 steps: Deploying application,Launching application,Pulling device files,Starting GDB server,Starting GDB debugger, Start Java debugger.
  3. What’s your debug mode? You can get it via Project Properties>Debugging>Debug Mode.
  4. Please send the complete log and logcat output again.

Victor

Hey Victor, Disabling Fast Deploy (which was set to Default) seemed to do the trick and I’m able to drop in break points. Thank you. Little concerned that this was a problem though.

Anyway Log cat before switching the flag is listed below.

This occured after deployment and application launching, It was right after the stage of attempting to attach the debugger. Java Debugger was turned off by me at one point as that isn’t really necessary in a NativeActivity (unless I’m mistaken, in which case please take a moment to let me know). My debug mode was set to Java and native Mode, before switching it to Native Mode.

Thanks again for your assistance. I hope this extra information is something that is still of use to you even if it was more about tracking down the problem.

Log Cat Output Below:

04-09 00:11:52.765 28986 28986 I art : Late-enabling -Xcheck:jni
04-09 00:11:52.793 28986 28986 W ActivityThread: Application com.mythweavers.escape is waiting for the debugger on port 8100…
04-09 00:11:52.794 28986 28986 I System.out: Sending WAIT chunk
04-09 00:12:05.070 28986 28992 I art : Debugger is active
04-09 00:12:05.218 28986 28986 I System.out: waiting for debugger to settle…
04-09 00:12:05.218 28986 28986 I System.out: Debugger has connected
04-09 00:12:07.647 28986 28986 I System.out: waiting for debugger to settle…
04-09 00:12:07.848 28986 28986 I System.out: waiting for debugger to settle…
04-09 00:12:08.049 28986 28986 I System.out: waiting for debugger to settle…
04-09 00:12:08.249 28986 28986 I System.out: waiting for debugger to settle…
04-09 00:12:08.450 28986 28986 I System.out: waiting for debugger to settle…
04-09 00:12:08.650 28986 28986 I System.out: waiting for debugger to settle…
04-09 00:12:08.851 28986 28986 I System.out: waiting for debugger to settle…
04-09 00:12:09.052 28986 28986 I System.out: debugger has settled (1404)
04-09 00:12:09.207 28986 28986 W art : Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.mythweavers.escape-2/base.apk --oat-file=/data/dalvik-cache/arm/data@app@com.mythweavers.escape-2@base.apk@classes.dex) because non-0 exit status
04-09 00:12:09.208 28986 28986 W art : Failure to verify dex file ‘/data/app/com.mythweavers.escape-2/base.apk’: out-of-order direct method indexes 7 and 6
04-09 00:12:09.334 28986 28986 D AndroidRuntime: Shutting down VM
04-09 00:12:09.340 28986 28986 E AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
04-09 00:12:09.340 28986 28986 E AndroidRuntime: … 12 more
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at java.lang.Class.classForName(Native Method)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: Suppressed: java.lang.ClassNotFoundException: com.nvidia.pentak.LaunchProxyActivity
04-09 00:12:09.340 28986 28986 E AndroidRuntime: … 6 more
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1406)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.ActivityThread.-wrap1(ActivityThread.java)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4720)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.LoadedApk.makeApplication(LoadedApk.java:568)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.LoadedApk.getClassLoader(LoadedApk.java:376)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:58)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at dalvik.system.PathClassLoader.(PathClassLoader.java:65)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:48)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at dalvik.system.DexPathList.(DexPathList.java:120)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at dalvik.system.DexPathList.makePathElements(DexPathList.java:248)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at dalvik.system.DexPathList.loadDexFile(DexPathList.java:279)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at dalvik.system.DexFile.(DexFile.java:59)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at dalvik.system.DexFile.(DexFile.java:80)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at dalvik.system.DexFile.openDexFile(DexFile.java:295)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at dalvik.system.DexFile.openDexFileNative(Native Method)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.mythweavers.escape-2/base.apk
04-09 00:12:09.340 28986 28986 E AndroidRuntime: … 9 more
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2359)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.nvidia.pentak.LaunchProxyActivity” on path: DexPathList[[zip file “/data/app/com.mythweavers.escape-2/base.apk”],nativeLibraryDirectories=[/data/app/com.mythweavers.escape-2/lib/arm, /data/app/com.mythweavers.escape-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5457)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:104)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1345)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2518)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
04-09 00:12:09.340 28986 28986 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mythweavers.escape/com.nvidia.pentak.LaunchProxyActivity}: java.lang.ClassNotFoundException: Didn’t find class “com.nvidia.pentak.LaunchProxyActivity” on path: DexPathList[[zip file “/data/app/com.mythweavers.escape-2/base.apk”],nativeLibraryDirectories=[/data/app/com.mythweavers.escape-2/lib/arm, /data/app/com.mythweavers.escape-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
04-09 00:12:09.340 28986 28986 E AndroidRuntime: Process: com.mythweavers.escape, PID: 28986
04-09 00:12:09.340 28986 28986 E AndroidRuntime: FATAL EXCEPTION: main

Hi Cruxics,

Glad to hear to your issue is fixed. It’s a known issue and tracked internally,thank you for your logcat log.

Victor