1
我已经将一个项目作为库,同时将该库项目称为主项目。获取错误:*****。apk未找到
我做了一个动作栏类,并将其作为一个库,同时在主项目中调用它。
我在控制台上收到错误找不到* Actionbar.apk!
虽然logcat的显示如下:
01-30 13:36:47.595: E/AndroidRuntime(404): FATAL EXCEPTION: main
01-30 13:36:47.595: E/AndroidRuntime(404): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sos.emergency/com.sos.emergency.SOSHome}: java.lang.NullPointerException
01-30 13:36:47.595: E/AndroidRuntime(404): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
01-30 13:36:47.595: E/AndroidRuntime(404): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
01-30 13:36:47.595: E/AndroidRuntime(404): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
01-30 13:36:47.595: E/AndroidRuntime(404): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
01-30 13:36:47.595: E/AndroidRuntime(404): at android.os.Handler.dispatchMessage(Handler.java:99)
01-30 13:36:47.595: E/AndroidRuntime(404): at android.os.Looper.loop(Looper.java:123)
01-30 13:36:47.595: E/AndroidRuntime(404): at android.app.ActivityThread.main(ActivityThread.java:4627)
01-30 13:36:47.595: E/AndroidRuntime(404): at java.lang.reflect.Method.invokeNative(Native Method)
01-30 13:36:47.595: E/AndroidRuntime(404): at java.lang.reflect.Method.invoke(Method.java:521)
01-30 13:36:47.595: E/AndroidRuntime(404): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-30 13:36:47.595: E/AndroidRuntime(404): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-30 13:36:47.595: E/AndroidRuntime(404): at dalvik.system.NativeStart.main(Native Method)
01-30 13:36:47.595: E/AndroidRuntime(404): Caused by: java.lang.NullPointerException
01-30 13:36:47.595: E/AndroidRuntime(404): at com.sos.emergency.SOSHome.onCreate(SOSHome.java:35)
01-30 13:36:47.595: E/AndroidRuntime(404): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-30 13:36:47.595: E/AndroidRuntime(404): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
01-30 13:36:47.595: E/AndroidRuntime(404): ... 11 more
我正在根据给定的链路
http://thiranjith.wordpress.com/2011/07/15/actionbar-design-pattern-example-for-android/
与其他参照作为沿着工作,
http://developer.android.com/guide/developing/projects/projects-eclipse.html
和
http://developer.android.com/guide/topics/ui/actionbar.html
我已经打扫我的项目好几次,也试过在网上能找到的各种解决方案,但未能解决这个问题。
我的代码段我得到的错误,
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.home_screen);
ActionBar = (***_Actionbar) findViewById(R.id.actionBar);
ActionBar.setTitle(R.string.app_name); //getting error here
ActionBar.setHomeLogo(R.drawable.ic_title_home_default);
请在开始活动的位置添加代码片段。看起来好像在Manifest文件中没有您的活动条目。 – 2012-01-30 08:25:30
只是试图清理你的项目,看看apk是否生成或不在bin文件夹中。 – Sumant 2012-01-30 08:34:07
@ Sumant:我做到了,仍然没有工作。 – Beenal 2012-01-31 10:32:40