在Eclipse中升级项目

时间:2014-01-01 10:50:19

标签: java android eclipse

01-01 18:37:09.121: D/jdwp(25092): sendBufferedRequest : len=0x43
01-01 18:37:09.124: W/asset(25092): AssetManager-->addDefaultAssets CIP path not exsit!
01-01 18:37:09.162: D/AndroidRuntime(25092): Shutting down VM
01-01 18:37:09.162: W/dalvikvm(25092): threadid=1: thread exiting with uncaught exception (group=0x41ec99a8)
01-01 18:37:09.170: E/AndroidRuntime(25092): FATAL EXCEPTION: main
01-01 18:37:09.170: E/AndroidRuntime(25092): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.javac101/com.example.javac101.MainActivity}: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.app.ActivityThread.access$600(ActivityThread.java:162)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.os.Handler.dispatchMessage(Handler.java:107)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.os.Looper.loop(Looper.java:194)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.app.ActivityThread.main(ActivityThread.java:5371)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at java.lang.reflect.Method.invokeNative(Native Method)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at java.lang.reflect.Method.invoke(Method.java:525)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at dalvik.system.NativeStart.main(Native Method)
01-01 18:37:09.170: E/AndroidRuntime(25092): Caused by: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
01-01 18:37:09.170: E/AndroidRuntime(25092):    at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:252)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2670)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2915)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:277)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.app.Activity.setContentView(Activity.java:1881)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at com.example.javac101.MainActivity.onCreate(MainActivity.java:69)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.app.Activity.performCreate(Activity.java:5122)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
01-01 18:37:09.170: E/AndroidRuntime(25092):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
01-01 18:37:09.170: E/AndroidRuntime(25092):    ... 11 more

我们在Froyo版本中使用eclipse创建了一个Android应用程序,直到问题出现jelly bean 4.2.0,我们想在Jelly bean 4.2.2中运行该应用程序。我尝试升级 eclpise中的minSdkVersion targetSdkVersion ,当我在4.2.2我的API中尝试时,应用程序仍然崩溃,这是上面的输出。我也转到{{1平台已经4.2.2

2 个答案:

答案 0 :(得分:1)

只需在AndroidManifest.xml中将此行android:theme="@android:style/Theme"与MainActivity一起添加,如下所示,

<activity
        android:name=".MainActivity"
        android:theme="@android:style/Theme" >
</activity>

答案 1 :(得分:0)

中的布局XML存在一些问题
com.example.javac101.MainActivity.onCreate() at line#69 setContentView()

你必须尝试这样的事情:

getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.<your layout>);

但是在最新版本的Android设备中使用Action bar而不是title。