安卓:活动不是在清单中注册 [英] Android: Activity not registered in the manifest

查看:203
本文介绍了安卓:活动不是在清单中注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<uses-sdk android:minSdkVersion="7" />

<application
    android:description="@string/app_description"
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Light" >
    <activity
        android:name="com.xyz.Main.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

和皮棉工具告诉我,我的活动没有在清单登记,如果我尝试运行它,LogCat中亲切地告诉我:

And the Lint-tool tells me that my activity isn't registered in the manifest and if I try to run it, LogCat kindly tells me:

了java.lang.RuntimeException:无法实例活动ComponentInfo {com.name/com.xyz.Main.MainActivity}:抛出java.lang.ClassNotFoundException:com.xyz.Main.MainActivity

这是我发疯,我已经重新安装了Eclipse以及更新的SDK和东西API级别17,现在我似乎无法执行我自己的应用程序。我有绝对不知道什么是地狱的错在这里,显然该活动非常清楚的manifest.xml文件中注册。

This is driving me nuts, I've re-installed Eclipse as well as updated the SDK and stuff to API-level 17 and now I seem to be unable to execute my very own app. I've got absolutely no idea what the hell's wrong here, apparently the activity is perfectly well registered within the manifest.xml.

在此先感谢。

推荐答案

我已经得到了解决。今天,我觉得有足够的意志力再一次让我的手在这个项目上,并试图港项目到Linux分发(这导致我的结论是,Linux是在屁股的Andr​​oid developent疼痛),以及整合为线通过线,以一个新的Andr​​oid项目。

I've got the solution. Today I felt motivated enough get my hands on this project again and tried to port the project to a Linux-distribution (which led me to the conclusion that Linux is a pain in the ass for Android developent) as well as to integrate it "line by line" to a new Android project.

我用来实现与字符串和放大器;整数接口具有一定的常量和值(例如为0x00可见)。不幸的是,Android的似乎与界面和活动类的麻烦。拆卸接口,使静态引用到常量所作的仿真器摆脱的问题。

I used to implement String- & Integer-interfaces with certain constants and values (e.g. 0x00 for "visible"). Unfortunately, Android seems to have trouble with interfaces and activity-classes. Removing the interface and making static references onto the constants made the emulator get rid of the problem.

public class MyActivity extends Activity implements Options // [...]
Btn.setVisibility(VISIBLE); // bad idea

public class MyActivity extends Activity // [...]
Btn.setVisibility(Options.VISIBLE); // good idea

希望这会帮助,至少有人搜索出该问题。

Hopefully this is gonna help at least someone searching for this issue.

这篇关于安卓:活动不是在清单中注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆