[英]Eclipse - Android - Invalid layout of java.lang.String at value
早上好,
我在Android ADT中安裝了Eclipse和插件。 我創建了一個新的android項目,它是經典的:
package com.example.test_android_2;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
但是當我運行此代碼時,控制台窗口中有以下內容:
Invalid layout of java.lang.String at value
Error occurred during initialization of VM
Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class
錯誤窗口中沒有錯誤,也沒有發生任何錯誤。 未檢測到我連接的設備。
當我點擊“運行方式”時,沒有項目(僅“無適用”)
安裝Eclipse或ADT Android有問題嗎?
你能幫我嗎 ?
謝謝
我遇到了這個問題,我認為最好的解決方案如下。 首先,SDK Manager必須安裝您要使用的版本。 其次,一旦安裝了版本,然后轉到運行配置並設置您已創建的Android項目。 第三,確保SDK verison與目標SDK以及Compile相同。 從您的初學者角度來看,我建議您從API 14(版本4)開始。 謝謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.