I've been using the Android development tools in Eclipse to make a proof-of-concept app for my employer, to show them what our company can do with apps. I've got a long history of programming with and without IDEs; I've written several internal Java tools using Eclipse. However, I've never messed around under the hood of Eclipse or the ADT.
I was hammering away at the project this morning, and I changed one simple string in res/values/strings.xml. I didn't even change the length of the string, just changed two characters from "35" to "50". When I hit Run to see the changes, I got this cryptic message in the console output:
[2012-02-21 13:56:58 - CableCalc2] ------------------------------
[2012-02-21 13:56:58 - CableCalc2] Android Launch!
[2012-02-21 13:56:58 - CableCalc2] adb is running normally.
[2012-02-21 13:56:58 - CableCalc2] Performing com.rletech.cablecalc2.CableCalc2 activity launch
[2012-02-21 13:56:58 - CableCalc2] Automatic Target Mode: Preferred AVD 'first_avd' is available on emulator 'emulator-5554'
[2012-02-21 13:56:58 - CableCalc2] WARNING: Unknown device API version!
[2012-02-21 13:56:58 - CableCalc2] Uploading CableCalc2.apk onto device 'emulator-5554'
[2012-02-21 13:57:01 - CableCalc2] Installing CableCalc2.apk...
[2012-02-21 13:57:01 - CableCalc2] Success!
[2012-02-21 13:57:01 - CableCalc2] Starting activity com.rletech.cablecalc2.CableCalc2 on device emulator-5554
[2012-02-21 13:57:01 - CableCalc2] ActivityManager: link_image[1995]: failed to link /system/bin/sh
[2012-02-21 13:57:01 - CableCalc2] ActivityManager: CANNOT LINK EXECUTABLE
[2012-02-21 13:57:01 - CableCalc2] ActivityManager:
... and I'm stuck there. I tried some other projects that I know should work, because they've worked before, including the classic HelloAndroid project. All projects give me this same failure.
I didn't change anything in the code. It's like the ADT or Eclipse changed something for me and forgot to tell me about it. Any clue on how I can fix it?
System details:
Eclipse Indigo SR1 build ID 20110916-0149. Downloaded some time ago.
Android Development Toolkit version 16.0.1.v201112150204-238534. Downloaded on 6-Feb-2012.
ADB version is 1.0.29
Emulator platform 2.2 (API level 8)
Update before posting: I also have a platform for 4.0.3 (API level 15), and everything still works when I change the Run Configuration to 4.0.3. That's fine, but our customers don't run out and buy new Androids every month, so we need to run it and test it on API level 8. And like I said, it stopped working on API level 8, rather abruptly and not for a predictable reason.
As a proof of concept, this isn't looking terribly good. So once again, how do I fix it?
--
Regards
Ray
WAY late to the party here, but I've found that you can get this error when /system/bin/linker is deleted from your Android device. (In my case, I was trying to update linker at runtime). A missing linker seems to throw this error on every executable, not just sh. In my case, I was able to restore /system/bin/linker with adb push, but the device still continued to have problems, and ultimately, completely re-flashing the OS was the only solution I found that worked.
Related
I am developing for Android using the adt bundle. When I deploy an app to a device I get a segmentation fault:
[2013-01-18 23:24:24 - test2] Android Launch!
[2013-01-18 23:24:24 - test2] adb is running normally.
[2013-01-18 23:24:24 - test2] Performing com.example.test2.MainActivity activity launch
[2013-01-18 23:24:29 - test2] Uploading test2.apk onto device '99000083935364'
[2013-01-18 23:24:30 - test2] Installing test2.apk...
[2013-01-18 23:24:31 - test2] Success!
[2013-01-18 23:24:31 - test2] Starting activity com.example.test2.MainActivity on device 99000083935364
[2013-01-18 23:24:33 - test2] ActivityManager: Segmentation fault
I can move the apk to the sdcard and it installs fine, but won't deploy directly from eclipse.
I have tried updating everything and cant seem to debug the app. What causes this Segmentation Fault?
You can try this. It helped me to avoid a similar error. In particular, my problems stemmed from the fact that I omitted a second string in my Manifest
android:screenOrientation="landscape"
android:configChanges="keyboardHidden|orientation">
I also had the issue.
Make sure your sdk and adt are of latest version.
If the issue still there then its due to the rom installed.
Some custom roms may leads to this issue.
Installation of busybox may lead to this issue.
Corrupted OS installation.
This can be solved by wiping all data and putting stock rom back.
I'm a freshman for the android developing, and I met a question that confuse me for a few days.
I run the simple "hello world" code (I promise there is no error in the code, cause I copy it directly from the homepage of SDK), then the emulator runs but my app is not installed in it. and the console is like this:
[2012-06-12 23:05:50 - HelloPig] ------------------------------
[2012-06-12 23:05:50 - HelloPig] Android Launch!
[2012-06-12 23:05:50 - HelloPig] adb is running normally.
[2012-06-12 23:05:50 - HelloPig] Performing com.example.hellopig.HelloPigActivity activity launch
[2012-06-12 23:05:50 - HelloPig] Automatic Target Mode: launching new emulator with compatible AVD 'aaa'
[2012-06-12 23:05:50 - HelloPig] Launching a new emulator with Virtual Device 'aaa'
[2012-06-12 23:05:55 - Emulator] emulator: emulator window was out of view and was recentered
[2012-06-12 23:05:55 - Emulator]
It just keep holding there, I think there should be something like installing app and success. I firstly thought the problem is eclipse cannot find my emulator, but there is no error. I have checked the build debug keystore path, it is the place where my emulator is.
I also have checked the environment variables, but I think there is no problem with them
(I can run java and adb in cmd)
I really have no idea, so could anyone help me?
following are the versions of the softwares:
jdk 1.6
ADT 18.0.0
SDK platform 1.5
eclipes java EE IDE for developers
Looking forward to hearing from anyone of you :)
I would suggest starting your emulator before trying to install your app. It looks like you are waiting for Android to start your emulator for you.
Otherwise there isn't enough information here. I would suggest running logcat (open a command prompt, and type 'adb logcat') which will give you more verbose logging information.
Post the output from your logcat (if your problem isn't immediately obvious).
I'm trying to run one of the Android sample apps in Eclipse. I've been through all the possible errors, and now I was finally able to run without any of them. But still, nothing works, and the emulator just has the "android" sign shining on it.
The log I have is:
[2011-12-26 21:18:50 - AccelerometerPlayActivity] ------------------------------
[2011-12-26 21:18:50 - AccelerometerPlayActivity] Android Launch!
[2011-12-26 21:18:50 - AccelerometerPlayActivity] adb is running normally.
[2011-12-26 21:18:50 - AccelerometerPlayActivity] Performing com.example.android.accelerometerplay.AccelerometerPlayActivity activity launch
[2011-12-26 21:19:26 - AccelerometerPlayActivity] Uploading AccelerometerPlayActivity.apk onto device 'emulator-5554'
[2011-12-26 21:19:26 - AccelerometerPlayActivity] Installing AccelerometerPlayActivity.apk...
[2011-12-26 21:19:28 - AccelerometerPlayActivity] Success!
[2011-12-26 21:19:28 - AccelerometerPlayActivity] Starting activity com.example.android.accelerometerplay.AccelerometerPlayActivity on device emulator-5554
I already changed the configuration of the AVD, created a new one, etc. Nothing seems of any help
Does anyone have any idea?
Thanks
I would try to 'downgrade' the emulator.
I'm assuming you aren't programming for the newest android 4.0+ or something like that,
(Samsung galexy s is 2.0 or 2.2, I think).
When I had that problem it helped me alot.
try it :)
I had similar problem a long time ago. Make sure that path to your android sdk (or adb) doesn't contain any national symbols (cyrillic in my case) except English.
If you using Windows, also check your profile name.
Wait a little more.... in some computers, the emulator wait up to 10 minutes to run first time. Its a lot of time, but, next compile time, donĀ“t close it, just clear proyect, build all and run, and it will work.
I've got a Galaxy Nexus and today it started to give me a Segmentation fault error when deploying to it:
[2011-12-07 16:19:17 - Flinders Lite] Android Launch!
[2011-12-07 16:19:17 - Flinders Lite] adb is running normally.
[2011-12-07 16:19:17 - Flinders Lite] Performing com.istudentgroup.flinders.lite.activity.MainMenuActivity activity launch
[2011-12-07 16:19:20 - Flinders Lite] Uploading Flinders Lite.apk onto device '0146914B19021011'
[2011-12-07 16:19:23 - Flinders Lite] Installing Flinders Lite.apk...
[2011-12-07 16:19:25 - Flinders Lite] Success!
[2011-12-07 16:19:25 - Flinders Lite] Starting activity com.istudentgroup.flinders.lite.activity.MainMenuActivity on device 0146914B19021011
[2011-12-07 16:19:26 - Flinders Lite] ActivityManager: Segmentation fault
I can open a shell in to the handset and can navigate the directory structure and the phone seems to be operating normally otherwise.
Does anyone know what is going on? How do I fix it?
Logcat output : http://pastebin.com/VxGdAbap
Have you updated the Android SDK / ADB / Eclipse recently?
I had a similar problem after an update due to inconsistency between versions.
The problem was corrected after forcing eclipse to check for updates (and install them) of anything that I had installed.
Reflashing the stock image, using tools from the superboot from modaco worked. I used the 4.0.1 (ITL41F) version as this includes the recently released volume bug fix.
I also had the issue.
Make sure your sdk and adt are of latest version.
If the issue still there then its due to the rom installed.
Some custom roms may leads to this issue.
Installation of busybox may lead to this issue.
Corrupted OS installation.
This can be solved by wiping all data and putting stock rom back.
I am brand new to Eclipse and Android, but somewhat familiar with Java. That having been said, I tried to follow the 'Hello Android' tutorial from the developer site using the latest Eclipse (Galieo) and the 2.1 Android SDK, I am on a Macintosh running Snow Leopard (OS X 10.6). I have a default virtual device (though my target is actually for phones like my own HTC Incredible which has the snapdragon processor and of course all the latest accoutrement in smart phones).
Everything seemed to go okay until I went to RUN>RUN and then selected 'Android Application'. My computer spins its wheels for a while and then I see two errors. I have pasted the output from Eclipse below:
[2010-05-04 01:53:46 - HelloAndroid] ------------------------------
[2010-05-04 01:53:46 - HelloAndroid] Android Launch!
[2010-05-04 01:53:46 - HelloAndroid] adb is running normally.
[2010-05-04 01:53:46 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-05-04 01:53:46 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'myAVD'
[2010-05-04 01:53:46 - HelloAndroid] Launching a new emulator with Virtual Device 'myAVD'
[2010-05-04 01:53:58 - HelloAndroid] New emulator found: emulator-5554
[2010-05-04 01:53:58 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2010-05-04 01:53:59 - Emulator] 2010-05-04 01:53:59.501 emulator[10398:903] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2010-05-04 01:54:23 - HelloAndroid] emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!
I never do see the text in the emulator and the emulator crashes with a message about it quitting unexpectedly.
The crash report states:
Process: emulator [10472]
Path: /Applications/android-sdk-mac_86/tools/emulator
Identifier: emulator
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: eclipse [10468]
Date/Time: 2010-05-04 02:25:41.153 -0500
OS Version: Mac OS X 10.6.3 (10D573)
Report Version: 6
Interval Since Last Report: 2558914 sec
Crashes Since Last Report: 4
Per-App Crashes Since Last Report: 2
Anonymous UUID: C5F178C1-5290-4CA9-AD6E-E9C4F5582754
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000001fd2f000
Crashed Thread: 3
NOTE: Running the emulator from the command line with:
iainnitro-Mac:tools iainnitro$ ./emulator -avd myAVD
2010-05-04 02:49:23.011 emulator[10556:903] Warning once: This application, or a library it
uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw
and move to Quartz.
Segmentation fault
iainnitro-Mac:tools iainnitro$
yields a segmentation fault(as noted above from the terminal output). So the emulator is dying on its own before anything can be shown.
I have tried restarting the ADB processes.
The actual code is line by line from the tutorial and I have never been able to get to the XML part yet.
I am not sure what is wrong with my environment setup or if it is just an incompatibility with Snow Leopard? I would REALLY appreciate any help in resolving this as I am very interested in developing on this platform.
Thank-you,
Mike N Lawrence, Kansas
No direct experience, but this seems to be a recurrent issue:
This thread suggests:
You haven't let the emulator boot all the way up. Start it then wait until you see a desktop, just like on a real phone.
This one mentions (I suspect point 1. is not a concern for you):
Get more RAM. I was running on 256 MB (which I believe is below minimum requirements), just upgraded today to 1024 MB (long time coming), application now starts fine. Although I still do see some error messages in the emulator, they don't seem to actually do anything.
Install from command line. This is a bit laborius, but you can launch an emulator from the command line (assuming <android sdk path>\tools is added to your PATH variable) just type emulator, then browse to the location of your_app_here.apk, and execute
adb install your_app_here.apk
If you launch the emulator from Eclipse, execute adb kill-service and then adb start-service first (or kill-server / start-server. not sure the exact commands). Then your app will be installed on the emulator.
Also (a bit old but might still be relevant)
Maybe the emulator is running so slow, and the adb server, or another component like "DDMS" is a little "desperate" because seems it's waiting to the emulator to iniatialize the some HOME aplication.
But the emulator is running slow, the console in Eclipse send a message: emulator-5554
disconnected! Cancelling 'com.android.hello.HelloAndroid' launch!; and the emulator continues running normally and boot it's system, but don't run application that I build.
So for that problem I run program, and when the emulator is opened, I go back to eclipse in DDMS Perspective and in the Device tab y press a button "restart adb server" before the console shows me the message of "emulator-5554 disconnected!".
I do it several times until the emulator finally boot the OS.
After booted the OS on the emulator, eclipse don't send that disconnect error, and "sends" the app that I've built, also the console shows messages about this.
Then finally appears on the mobile "Hello, Android".
There has been a discussion on this with two proposed solutions
http://code.google.com/p/android/issues/detail?id=724
Comment 17 by zachrcrowe, Jan 06, 2010
FYI - I had to change a line in the Hello Android example to read
this.setContentView(tv); in order for it to work. As mentioned above, the deprecation
warning shouldn't affect the functionality of the emulator.
Comment 18 by mfrony, Jan 14, 2010
I had the same problem when I ran the Hello Android example. The way I solved it and
could run my first Android code was by changing the Project Build Target from 1.1 to 1.5.
This seems to be a timing issue. For some reason Eclipse attempts to load the application on to the emulator before it is "ready". I'm not sure why this occurs but I did find a work around: just start the emulator from the command line before you run the application.
Start clean by closing Eclipse (maybe the OP didn't exit Eclipse before he tried to run via the command line?)
Start the emulator via Terminal by navigating to the android-sdk-mac_86/tools directory and typing:
./emulator -avd my_avd
Open Eclipse and attempt to run the tutorial again using the same steps as before
A dialog box should open asking whether you would like to start a new AVD or use the one that is already running--choose to use the one that is already running.
what i did was to move the circle that appears when the AVD launches to the unlock position, and there it was 'Hello, Android'!
I had this same problem when I tried to run the emulator using a 4.0 AVD. It used to crash at the bootup screen and show 'Segmentation fault' in the console. I was able to fix it by increasing the SD card size of the AVD to 1GB from 32MB.
For whatever reason, I stopped getting the segmentation fault when I added:
this.setContentView(tv);
the 'this' seemingly solved the issue. The seg fault happens if you try to run the emulator without any .apk file I assume. (I was getting that from the command line as well). I hope the tutorial will be updated.
See Related post
Another related post
This worked on Linux for me:
Run Emulator (Wait for the home screen of the Emulator to load)
Click Window > Open Perspective > DDMS
In Devices Panel, click on drop down menu > Reset adb
Run project