Unable to download trace file - android

Whenever I switch to DDMS view and start method profiling, I get the following error message when I stop profiling:
Method Profiling Error:
Unable to download trace file:
Remote object doesn't exist!
This only happens with 1.6 and 2.1 AVDs, 2.2 and 2.3 work fine. I've been having this problem ever since the latest update to the Eclipse Android plugin. I'm using Eclipse 3.5.2 on Ubuntu 10.04 with Android Development Toolkit version 8.0.0.v201011171904-77661. Let me know if you need any more information.
Edit 1:
Logcat output
Edit 2:
The trace file is actually created on the sdcard and I can pull it with adb or from DDMS file explorer and view it in traceview. I just get the error message when I click on the "stop method profiling" icon and the trace file isn't automatically displayed. I tried deleting the AVDs and creating new ones, installing the latest plugin version, and reinstalling the plugin but the issue remains. I can live with it, but it'd be nice to get it working like it used to.

I've read that this method of profiling works only on Android 2.2 and higher. Sorry, can't find link now.
On lower versions you are still able profile via Debug.startMethodTracing(); ... Debug.stopMethodTracing();
Upd: check that you have properly mounted sdcard with read/write permissions and check that you have WRITE_EXTERNAL_STORAGE permission in your manifest file. May be problem in this, because beginning from Android 2.2 DDMS heap dump requests streaming directly out of the VM, removing the external storage requirement.
If you have all permissions, then post here logcat output please.
P.S. I've found a document that I mentioned.

I would check if you can download the file manually with adb pull for starters. At least them you know if there is a problem with the file access and you can also look at it with traceview externally.
In addition you might want to check if there is a bug regarding this feature and/or try the latest release available from aosp since the latest Android tools seem to have issues for a lot of developers.
Of course a clean reinstall or an install of an older version would also help you finding the problem potentially.

Related

Android studio isn't opening [duplicate]

Every time I run Android Studio, this loading screen pops up, but Android Studio stays here and doesn't load. It's like this following picture except that the loading bar is loaded all the way but stuck there. I am running Windows 10.
I have tried many things, including setting the system variables JDK_HOME to where my JDK is located and the same for JAVA_HOME. I have also set a path. I ran as admin many times and let AS through a firewall.
I have also restarted and reinstalled countless times.
The version of AS is 2.0, and I am running the latest versions of Java.
Any help?
Open file Android Studio setup directory/bin/idea.properties
Add disable.android.first.run=true to end
Restart Android Studio
PLEASE NOTE: This will break patch updating to the next version. We
now check full binary checksums on the whole installation to prevent
various install corruption bugs as well as to preserve application
signatures. Therefore, make a copy of this file first, and before
updating, put it back.
Please try the following method to fix that issue:
Find the folder of your AndroidStudio: based on the following directory
macOS: ~/Library/Application Support/Google/AndroidStudio[version]
Delete the AndroidStudio folder.
Restart
Ref:https://developer.android.com/studio/known-issues#studio-config-directories
In order to know how to debug the problem, I executed the bin\studio.bat script in the terminal and inspected the actual Idea exceptions in order to fix the problem.
For me, this was the issue:
ERROR - llij.ide.plugins.PluginManager - java.net.BindException: Address already in use: bind
java.util.concurrent.CompletionException: java.net.BindException: Address already in use: bind
This means the plugin manager is trying to listen on a port that is not available. Is something listening on that port? For me, it was the stupid "excluded ports" by Windows, so I simply stopped the service:
net stop winnat (as administrator), and confirmed that Android Studio started to work.
No need to re-install, delete precious configuration (and plugins, etc.). Just read the log provided by the bin\studio.bat script, and I was able to fix the issue.

Unable to view HTML trace report generated by Systrace tool in Android SDK

I am trying to generate trace reports with Systrace tool in the Android SDK, but I cant view the report in the browser. It is blank and does not contain any information. I read in some forums that I need to open the report in Chrome browser, I opened it with Chrome as well but the report is blank.
I have enabled USB Debugging from the Developer Options and device is running Android 4.2 and I am using DDMS tool from the Android SDK to generate the traces.
http://developer.android.com/tools/help/systrace.html
Firstly, if anyone is using Chrome v50.0+ on OS X or Windows, just try this please.
open chrome browser and go to "chrome://tracing"
in the tracing page, click load and select the systrace generated html file.
Secondly, I think it's a bug which is confirmed by Google.
It looks like this is because modern versions of Chrome have deprecated the Object.observe function[1][2].
For more information, please see this, https://code.google.com/p/android/issues/detail?id=57135
I also have this problem running chrome on linux.
It seems they have bug in the implementation of javascript drawing the results.
Check JavaScript console.
Mine says.
Uncaught TypeError: undefined is not a function
On Windows , I just can see the result by doing this:
get the trace.html
open trace.html with chrome browser and open the chrome's developer tools then i find out there is 3 error in trace.html
showing like this
go to the error line ,then comment the error function
like this
save the modified html then refresh chrome , you can see the trace result
This is just not the best solution, but any way we can see the result.
I was having the same issue when capturing through eclipse on Ubuntu 12.04.
Worked around it by running the tool directly from the systrace folder (sdk/tools/systrace/)
./systrace.py -t 5 -o trace.html
Update your SDK using SDK manager, select tools and platforms tools to be updated.
Follow the normal procedure, and that's it. Chrome is recomended to see results.
I solved this issue just by updating the SDK, use the SDK manager select tools and platform tools for update and you're done. Python script doesn't work on Windows.
However even if the trace.html is generated and it can be seen, when data overflows, it is not possible to see the bottom part of the page. This because wasd navigation is not enough making the use of the scroll bar needed.
To do this you need to:
If you're in Linux modify the Python script and eliminate the overflow:hidden wherever is found.
If you're using SDK, edit the trace.html and eliminate the overflow:hidden wherever is found.
Hope it helps, it'll be nice that someone in Google can fix this on the source.
I just found the my trace.html, which failed to open in IE/Firefox/Chrome, opened fine in the latest Opera (on my Windows PC).
For me, it didn't work on Firefox v34 but worked in Chrome v37 and I am on Ubuntu 12.04.
I also faced similar issues while trying to open a Systrace generated html file (around 10 MB ) on Firefox 37.0.1. However the same file works brilliantly on Chromium Version 37.0.2062.120 Ubuntu 12.04 (281580) (64-bit).
I've done following:
cd $ANDROID_HOME/platform-tools
git clone https://android.googlesource.com/platform/external/chromium-trace/
mv systrace old-systrace
ln -s chromium-trace/catapult/systrace/systrace/ systrace
that fixed my systrace issue
systrace report work in latest chrome at least
You can try my sample trace.html file to check if your Chrome version is okay or not.
https://github.com/tngotran/systrace-android/blob/master/trace.html
Also here is a link to the official trace.html sample from Google https://source.android.com/devices/tech/debug/perf_traces.zip
By the way, from my experience, the command tool python systrace.py can create an output file trace.html without error, but result is an empty file (even the file size is larger than 5Mb or more).
We have to:
Run the command adb root from your terminal to restart adbd as root
Run the python systrace.py again
Then check your created report .html file in Chrome :)
Suggestion: Try to trace an emulator (they are for development)
The issue may be manufacture customization to the Android OS, making the problem potentially a device configuration issue caused by the manufacture.
There are several answers that may be helpful here.
None of these worked for me... but because of answer https://stackoverflow.com/a/52379567/1815624
I found that it would load data by using the linked trace files:
Also here is a link to the official trace.html sample from Google
https://source.android.com/devices/tech/debug/perf_traces.zip
Using adb root did not work.
On a different device it worked flawlessly right off as well as using an emulator.

Error while installing application (INSTALL_FAILED_DEXOPT)

I am working with ccr4j API in Android so when I run my project its thrown an error like:
Error while installing application (INSTALL_FAILED_DEXOPT)
I find from net and same site also, did all trying like,
1. Uninstalled same application from device.
2. Run Emulator with Wipe User Data.
But still same error comes.
So anyone know why its thrown this kind of error?
This most likely has to do with the size of classes.dex. On anything pre-ICS dexopt will fail on anything over 5mb. Check the size of classes.dex in your apk. It would also be good to see what your method count is as dex has a 65536 method/field limit.
I have same problem. Checked classes.dex file and it is about 7mb's. I'll try to find a solution. I hope Facebook's solution solves mine too.
By the way thanks for information #Jared.
https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920
Edit 1: I've solved this problem by using proguard optimization. My previous classes.dex file was about 7mb, and after proguard optimization it became 4mb. And now I can run this obfuscated and optimized apk on 2.2 and 2.3 devices.
Edit 2: Official Google Multi Dex support is the best solution for this issue. https://developer.android.com/tools/building/multidex.html
Find Android SDK folder. (Usually C:\User\AppData\Local\Android\sdk) Delete folders which starts with dot(.), they are temporary downloads files. Then delete Android Emulator from SDK Manager. Then run Android Studio as administrator and then download and install Android Emulator again. And make sure you have installed Intel H.A.X.M.. Now you can create emulator and use it without errors.

Xamarin Android installation fails

I'm trying to install Xamarin for Android and I'm having a really weird issue and I can't find any help anywhere.
Once the installation starts and I click on Next button in the screen with the answer about if I want to collect information, it doesn't do anything. Checking the log file it always cancel the installation due to an internal error, I will copy the log section that's giving me the information:
[287C:256C][2013-01-13T14:02:06]: Caching bundle from: 'C:\Users\MAXIPO~1\AppData\Local\Temp\{e9ab888e-6304-4ba3-b36a-b1a350d36592}\.be\XamarinSetup.exe' to: 'C:\ProgramData\Package Cache\{e9ab888e-6304-4ba3-b36a-b1a350d36592}\XamarinSetup.exe'
[287C:256C][2013-01-13T14:02:07]: Registering bundle dependency provider: {e9ab888e-6304-4ba3-b36a-b1a350d36592}, version: 3.0.0.0
[2464:19E4][2013-01-13T14:02:07]: Prompt for source of container: WixAttachedContainer, path: C:\Soft\Android\XamarinSetup.exe
[2464:19E4][2013-01-13T14:02:07]: Failed to resolve source for file: C:\Soft\Android\XamarinSetup.exe, error: 0x80070642.
[2464:19E4][2013-01-13T14:02:07]: Error 0x80070642: Failed while prompting for source (original path 'C:\Soft\Android\XamarinSetup.exe').
[2464:19E4][2013-01-13T14:02:07]: Failed to acquire container: WixAttachedContainer to working path: C:\Users\MAXIPO~1\AppData\Local\Temp\{e9ab888e-6304-4ba3-b36a-b1a350d36592}\4675EB82A6A7F3C48F80571AB6E8495BD1C803BA, error: 0x80070642.
[2464:2930][2013-01-13T14:02:07]: Error 0x80070642: Failed while caching, aborting execution.
Failed to resolve source for file : XamarinSetup.exe. This file doesn't exist ever, I've never found it even refreshing the folder over and over during installation in case it's deleted during the process. I can see it starts copying files into the temp folder, and suddenly all of them dissapear (I'm sure due to the cancellation). I'm running it in Windows 7, any idea? I've been looking for a solution for days even changing permissions in my system, giving access to guest, my user, administrator, and so worth to all the paths just in case.
Regards.
Despite of the problem itself I could finally install everything. Thanks to the Xamarin support I knew the automatic installation doesn't work always, so it's much better to install every package manually. So the instructions they gave me are the following ones:
It looks like a manual installation would get the trial version of Mono for Android installed. Please follow the below instructions:
Please download and install packages shown below in the order listed:
JDK 1.6: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u31-download-1501634.html
Please choose the jdk-6u31-windows-i586.exe installer from the list above.
Android SDK: http://dl.google.com/android/installer_r20-windows.exe
After the main installer is done, please open the SDK Manager and install the following platform APIs: 7,8,10,12,14
GTK#: http://download.xamarin.com/Installer/gtk-sharp-2.12.10.win32.msi
MonoDevelop: http://download.xamarin.com/monodevelop/Windows/MonoDevelop-3.0.5.msi
Mono for Android SDK: http://download.xamarin.com/MonoforAndroid/Windows/mono-android-4.4.55.104956787.msi
You can skip steps 3 and 4 if you don't need/want to use MonoDevelop and use VisualStudio (2010 Professional or better) instead. In that case you must have VS installed before proceeding with step 5.
Always keep in mind to install the API's in the step 2, also JDK 1.6 is not the last one anymore so it will prompt you to install 1.7 instead of this one.

Android SDK beginner question

I'm a n00b developer at my second attempt to use the Android SDK. I'm
developing on the Mac platform and I've noticed that the latest
version of the SDK doesn't include anything except the tools (so I
have no plugins, no targets to choose from inside the package I
downloaded).
So I tried to use the Android SDK and AVD Manager to download and
install some, however, I got this error:
Failed to fetch URL https://dl-ssl.google.com/android/repository/
I went to the settings and checked the box to force fetching via HTTP,
but no result. I was suggested to look for a configuration file, but
couldn't find any.
Any suggestions? I'm dying to get my hands dirty with the SDK.
Whenever I've seen that error, I've just retried the download several times and eventually it went through. I've only run into it when I was behind a proxy, but that might not be your problem.
Here you have a Android tutorial, step by step.
http://www.vogella.de/articles/Android/article.html
Its means that you are behind a proxy.Go tools->options in your android SDK manager and enter your http Proxy server and port and it'll work.

Categories

Resources