android application killed right after launch
I changed some code on an android application that was working perfectly fine at least 3 days ago (note, this was not three days of coding, I have not done THAT many changes). Now, instead of running along on its merry way, it is ambushed and killed as soon as it gets out of the door. At least, I think that I am interpreting the output correctly:
[2010-08-06 14:07:04 - chart] Android Launch!
[2010-08-06 14:07:04 - chart] adb is running normally.
[2010-08-06 14:07:04 - chart] Performing org.achartengine.chartdemo.demo.ChartDemo activity launch
[2010-08-06 14:07:04 - chart] Automatic Target Mode: using device 'HT03LHF01264'
[2010-08-06 14:07:04 - chart] WARNING: Application does not specify an API level requirement!
[2010-08-06 14:07:04 - chart] Device API version is 3 (Android 1.5)
[2010-08-06 14:07:04 - chart] Uploading chart.apk onto device 'HT03LHF01264'
[2010-08-06 14:07:04 - chart] Installing chart.apk...
[2010-08-06 14:07:08 - chart] Success!
[2010-08-06 14:07:08 - chart] Starting activity org.achartengine.chartdemo.demo.ChartDemo on device
[2010-08-06 14:07:11 - chart] ActivityManager: Can't dispatch DDM chunk 46454154: no handler defined
[2010-08-06 14:07:11 - chart] ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined
[2010-08-06 14:07:12 - chart] ActivityManager: Starting: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} comp={org.achartengine.chartdemo.demo/org.achartengine.chartdemo.demo.ChartDemo} }
[2010-08-开发者_开发百科06 14:07:12 - chart] ActivityManager: [1] Killed am start -n org....
Anyway, does anybody have ideas as to what might be causing the immediate killing of a program?
Problem identified by Aidanc. The manifest file that was giving me trouble was
<?xml version="1.0" encoding="utf-8" ?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.achartengine.chartdemo.demo" android:versionCode="1" android:versionName="1.0.0">
- <application android:icon="@drawable/icon" android:label="@string/app_name" android:permission="android.permission.CAMERA">
- <activity android:name=".ChartDemo" android:label="AChartEngine demo">
- <intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="org.achartengine.chartdemo.demo.chart.XYChartBuilder" />
<activity android:name="org.achartengine.GraphicalActivity" />
<activity android:name=".GeneratedChartDemo" />
<activity android:name="DisplayImage" />
</application>
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-sdk android:minSdkVersion="3" />
</manifest>
perhaps a permissions problem? Have you set permissions correctly for the code you added in the Manifest file? its hard to tell without seeing some code. We need to know what exactly your program does at launch?
Also, whats the Log cat output? does anything run? what's it showing there? does an error show? if it does could you edit your question and put it there?
//edit
<application android:icon="@drawable/icon" android:label="@string/app_name" android:permission="android.permission.CAMERA">
Trying removing android:permission="android.permission.CAMERA"
from this
As oliver said, that is a serious problem.
Also I highly highly recommend the use of a version control system to track any and all changes made to your code base. For example GIT or SVN. I think SVN integrates into Eclipse better. That way you could just diff between two versions and know immediately what changed.
Your log says:
WARNING: Application does not specify an API level requirement!
That's quite a problem. There may be something wrong in your manifest around <uses-sdk />
If not, then you could also try Project/Clean in Eclipse to rebuild everything.
精彩评论