但是,由於許可證違規,我安裝了eclipse Helios,但無法安裝插件。我卸載了Java SDK 1.7,刪除了Eclipse文件夾,並下載了Eclipse JUNO(應該是最新版本)。我已經在Windows上安裝了Android sdk,但是,它看起來像Eclipse在導入它後第二次在不同的目錄中安裝它。將工作eclipse項目導入到新版本
我的問題是,我正在導入一個現有的項目,(新的其他..從源代碼生成Android項目),並沒有編譯錯誤。當我運行程序我得到這個錯誤日誌:
12-14 00:06:39.906: E/AndroidRuntime(668): FATAL EXCEPTION: main
12-14 00:06:39.906: E/AndroidRuntime(668): java.lang.RuntimeException: Unable to start activity ComponentInfo{xxxxname.xnamepre.xnamepre2012/xxxxname.xnamepre.xnamepre2012.SplashScreen}: android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v7.widget.Space
12-14 00:06:39.906: E/AndroidRuntime(668): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.app.ActivityThread.access$600(ActivityThread.java:123)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.os.Handler.dispatchMessage(Handler.java:99)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.os.Looper.loop(Looper.java:137)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.app.ActivityThread.main(ActivityThread.java:4424)
12-14 00:06:39.906: E/AndroidRuntime(668): at java.lang.reflect.Method.invokeNative(Native Method)
12-14 00:06:39.906: E/AndroidRuntime(668): at java.lang.reflect.Method.invoke(Method.java:511)
12-14 00:06:39.906: E/AndroidRuntime(668): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-14 00:06:39.906: E/AndroidRuntime(668): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-14 00:06:39.906: E/AndroidRuntime(668): at dalvik.system.NativeStart.main(Native Method)
12-14 00:06:39.906: E/AndroidRuntime(668): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class android.support.v7.widget.Space
12-14 00:06:39.906: E/AndroidRuntime(668): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-14 00:06:39.906: E/AndroidRuntime(668): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.app.Activity.setContentView(Activity.java:1835)
12-14 00:06:39.906: E/AndroidRuntime(668): at xxxxname.xnamepre.xnamepre2012.SplashScreen.onCreate(SplashScreen.java:30)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.app.Activity.performCreate(Activity.java:4465)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
12-14 00:06:39.906: E/AndroidRuntime(668): ... 11 more
12-14 00:06:39.906: E/AndroidRuntime(668): Caused by: java.lang.ClassNotFoundException:
android.support.v7.widget.Space
12-14 00:06:39.906: E/AndroidRuntime(668): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
12-14 00:06:39.906: E/AndroidRuntime(668): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-14 00:06:39.906: E/AndroidRuntime(668): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.view.LayoutInflater.createView(LayoutInflater.java:552)
12-14 00:06:39.906: E/AndroidRuntime(668): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
12-14 00:06:39.906: E/AndroidRuntime(668): ... 21 more
在線SplashScreen.java:30代表setContentView(R.layout.splashscreen);
我沒碰過的文件。在res/layout
文件夾中是splashscreen.xml文件。
此外,如何將虛擬Android設備管理器的迷你圖標添加回我的工具欄?
編輯:我解決了這個問題:我在所有XML文件中都使用了android.support.v7.widget.Space小部件。我不知道爲什麼他們不能再使用了,我認爲eclipse爲兼容性問題添加了它們......如果現在在其他android上崩潰,它不會讓我感到驚訝......(意圖是2.2 ++(sdk8),它已經構建了目標sdk15 。我現在改變我的問題 - 刪除這些行會影響我的代碼嗎?我無法注意到模擬器中的任何差異,我絕對相信我沒有添加這些小部件。 – user1497119