得到错误:*****。找不到apk

时间:2012-01-30 08:21:59

标签: android apk android-actionbar

我将一个项目作为一个库,同时将该项目调用到主项目中。

我已经制作了一个动作栏类,并将其作为一个库,同时在主项目中调用它。

我在控制台上收到错误无法找到* 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);

1 个答案:

答案 0 :(得分:3)

转到项目 - >属性

从左侧列表中选择Android

取消选中“Is Library”复选框。