traceview command run issue - android

I am trying to use traceview to run some profiling against an Android application. I have wrapped the code that I want to trace with the following lines:
Debug.startMethodTracing("xxx");
// code
Debug.stopMethodTracing();
It successfully generated a trace file, that I pulled from sdcard using the following command line:
$./traceview ~/code/packages/performance_trance.trace
Exception in thread "main" java.lang.NoSuchMethodError: java.util.Arrays.copyOf([II)[I
at com.android.traceview.ProfileProvider.getColumnWidths(ProfileProvider.java:143)
at com.android.traceview.ProfileView.<init>(ProfileView.java:85)
at com.android.traceview.MainWindow.createContents(MainWindow.java:109)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.window.Window.open(Window.java:790)
at com.android.traceview.MainWindow.run(MainWindow.java:65)
at com.android.traceview.MainWindow.main(MainWindow.java:269)
I cannot understand this error message and I didn't find anything useful on Google.
Any help would be much appreciated.
Thanks!

try to open the file with your eclipse (with adt plugin)

Related

How to use phonegap-facebook-plugin in ionic?

I'm building an app in ionic/Cordova in which I want my users to be able to log in using Facebook. So I'm trying to install the PhonegapFacebookPlugin that I found on ngCordova.com.
The first thing that I noticed was that the docs on the ngCordova.com website for installing the plugin on Android are different from the docs on the project's github docs. So I first tried using the (simpler) instructions on the github page first, which after installing and trying to use the following code:
facebookConnectPlugin.login(['email'],
function(data){ console.log(JSON.stringify(data));},
function(error){console.log(error);});
led to these errors:
file:///android_asset/www/lib/phonegap-facebook-plugin-master/facebookConnectPlugin.js: Line 181 : Uncaught ReferenceError: require is not defined
file:///android_asset/www/js/app.js: Line 23 : Uncaught TypeError: Cannot read property 'Keyboard' of undefined
file:///android_asset/www/lib/ionic/js/ionic.bundle.js: Line 19387 : TypeError: Cannot call method 'login' of undefined
at Scope.$scope.fbLogin (file:///android_asset/www/js/controllers.js:10:31)
at $parseFunctionCall (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:20124:18)
at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:50863:9
at Scope.$eval (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:22178:28)
at Scope.$apply (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:22276:23)
at HTMLButtonElement.<anonymous> (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:50862:13)
at HTMLButtonElement.eventHandler (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:10823:21)
at triggerMouseEvent (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:2811:7)
at tapClick (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:2800:3)
at HTMLDocument.tapTouchEnd (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:2918:5)
After running into these errors, I tried continuing with the more extensive installation instructions on the ngCordova website, but the following command:
android update project --subprojects --path "platforms/android" --target android-19 --library "com.phonegap.plugins.facebookconnect/FacebookLib"
led to the following error:
Resolved location of library project to: /Users/kramer65/repos/my-app/platforms/android/com.phonegap.plugins.facebookconnect/FacebookLib
Error: Project folder '/Users/kramer65/repos/my-app/platforms/android/com.phonegap.plugins.facebookconnect/FacebookLib' is not a valid directory.
Error: No Android Manifest at: /Users/kramer65/repos/my-app/platforms/android/com.phonegap.plugins.facebookconnect/FacebookLib
This makes sense, because there is no folder called com.phonegap.plugins.facebookconnect/ in the platforms/android/ folder. I don't really know why not though. Do I need to copy-paste it there? Or did something go wrong in a previous step?
I'm stuck here and I really need to get this working. Any help would be greatly appreciated!

Can't dump the symbols of my native library : loadDataForPdb and loadDataFromExe failed

I copied the sample of Google breakpad for Android and added it to my project. I had first a problem to get the minidumps (I was triggering SIGSEGV errors but nothing was written on my SD card). I finally managed to get some minidumps (I don't really know how but that's not my main problem).
My problem is that I can't dump the symbols of my native libraries, it says the following error message :
dump_syms.exe libcppinterface.so > libcppinterface.so.sym
loadDataForPdb and loadDataFromExe failed
Open failed
Thanks for your help
The Breakpad tools are not very cross-platform friendly. You need to build dump_syms on a Linux machine in order to get a dump_syms binary that can read ELF/DWARF and produce debug symbols from your Android binaries. The Windows dump_syms.exe is only used for dumping symbols from MSVC-produced PDB files.

Error while opening trace file in Traceview in Android

I am using ADT 20.0.3. I am opening my trace file using following command:
C:>traceview "C:/Users/androdev/mytracefile.trace"
But I am getting following error:
Failed to read the trace filejava.io.IOException: Key section does not have an *end marker
at com.android.traceview.DmTraceReader.parseKeys(DmTraceReader.java:420)
at com.android.traceview.DmTraceReader.generateTrees(DmTraceReader.java:91)
at com.android.traceview.DmTraceReader.<init>(DmTraceReader.java:87)
at com.android.traceview.MainWindow.main(MainWindow.java:286)
mytracefile.trace is generated by using Debug.startMethodTracing("mytracefile") and Debug.stopMethodTracing() methods in my code.
Anyone know how to resolve this?
That simply means the tracefile is empty. Most probably Debug.stopMethodTracing() is not being called, and thus the tracefile data ends up being empty.

Android - Can't use traceview

I am trying to use traceview to run some profiling against an Android application. I have wrapped the code that I want to trace with the following lines:
Debug.startMethodTracing("xxx");
// code
Debug.stopMethodTracing();
It successfully generated a trace file, that I pulled from sdcard using the following command line:
./adb pull /sdcard/xxx.trace
However when running traceview like this:
./traceview /.../xxx.trace
I am getting the following error message:
Usage: java
com.android.traceview.MainWindow [-r]
trace -r regression only
I cannot understand this error message and I didn't find anything useful on Google.
Any help would be much appreciated.
Thanks!
make sure that Debug class you imported is this one : android.os.Debug
or do this :
android.os.Debug.startMethodTracing("xxx");
android.os.Debug.stopMethodTracing();

Finding source line on exception (Android, Eclipse)

When the Eclipse debugger stops due to an exception in my Android project, I can see the exception message in the variables window (e.g., "null pointer"), but how can I find out what Java code line my app was at when the exception occurred?
I can see a stack trace in the LH window, but selecting any of them doesn't seem to reveal anything that relates to my code.
Look in the LogCat view (in Eclipse Window-->Show View-->Other...-->Android-->LogCat) or in the adb logcat output from a terminal. The place to look will likely be the first mention of one of your classes below the line:
E/AndroidRuntime( ####): Caused by:

Categories

Resources