从Android 1.6到Android 2.2的升级和应用程序不起作用
我目前发现,我为 Android 1.6 开发的应用程序无法在 Android 2.2 上运行。我对此感到非常困惑,因为它是一个非常简单的应用程序,几乎什么也不做。
我得到的 Expeption 是这样的:
java.lang.RuntimeException: Unable to instantiate application [packagename].AndApp:
java.lang.ClassNotFoundException: [packagename].AndApp in loader
dalvik.system.PathClassLoader[/data/app-private/[packagename]-1.apk]
最奇怪的部分是,它在这里搜索的类不存在并且从来没有......
应用程序本身除了在文本视图中显示一些文本之外什么也不做。
在 Android 1.6 中我没有遇到这个问题,我也看不出原因,它的事件在 2.1 中有效。
有人知道这个问题可能是什么吗?
清单看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="[packagename]" android:versionName="1.02" android:versionCode="3">
<application android:label="@string/app_name" android:icon="@drawable/stop_48"
android:description="@string/Description" android:name="@string/app_name">
<activity android:name=".DefaultActivity" android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4"</uses-sdk>
</manifest>
I currently found out, that my Application developed for Android 1.6 does not work on Android 2.2. I'm quite puzzled about this, because its a very simple Application which almost does nothing.
The Expeption I get is like that:
java.lang.RuntimeException: Unable to instantiate application [packagename].AndApp:
java.lang.ClassNotFoundException: [packagename].AndApp in loader
dalvik.system.PathClassLoader[/data/app-private/[packagename]-1.apk]
The weirdest part is, that the Class it is searching for here does not exist and never has...
The app itself does nothing than show some text in a textview.
In Android 1.6 I dont get this problem and I cant see a reason, it event works in 2.1.
Has anybody a clue what this problem might be?
The Manifest looks like that:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="[packagename]" android:versionName="1.02" android:versionCode="3">
<application android:label="@string/app_name" android:icon="@drawable/stop_48"
android:description="@string/Description" android:name="@string/app_name">
<activity android:name=".DefaultActivity" android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4"</uses-sdk>
</manifest>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
问题出在你的清单文件中。您还没有关闭标签。请在之前添加以关闭标签。然后,您将不需要空类。
The problem is in your manifest file. You have not closed the tag. Please add before to close the tag. Then, you will not need the empty class.
经过一天的努力解决这个问题并尝试了很多奇怪的东西之后,我想出了简单地创建它正在寻找的这个类的想法。
起初它也不起作用,但后来我派生了这个空的 Application 类,这似乎是解决方案。
我不知道为什么,也不知道是什么导致了这个问题:也许它是 Eclipse 插件中的一个错误?
我对这个结果仍然不满意:我真的很想知道这里发生了什么!
如果有人对此有解释,请发帖。
after another day struggling with this problem and trying out alot of weird stuff, I came up with the Idea of just simply creating this class it was searching for.
At first it didnt work either, but then I derived this empty class of Application and this seemed to be the solution.
I'm not shure why and I dont know what caused this problem: maybe its a bug in the plugin for Eclipse?
I'm still not satisfied with this result: I would really like to know whats going on here!
If anybody has an explanation for that, pls post.
我有同样的问题。
我已经按照你说的解决了
我已经创建了该类:
现在它可以工作,但我不知道为什么
I have the same problem.
I've fixed as you said.
I've create the class:
And now it works but i don't know why