2011-12-30 8 views
8

この質問を誤って投稿した場合、まずはお許しください。私は多くの問題のためにstackoverflowを使用しましたが、これは私がすでに私の問題への答えを見つけることができませんでした初めてです。だから私が何か間違っていると私に知らせてください、私は再投稿/質問を編集します。XMLの解析中にエラーが発生しました:要素が見つかりません

今のところビジネスになります。私はちょうどAndroid SDKを使用して開発を開始しました。http://developer.android.com/resources/tutorials/hello-world.html#avdから xml編集部分を取得しました。また、xmlファイルmain.xmlとstrings.xmlにすべて変更を加えましたこのエラーが発生します。また、プロジェクトをコンパイルすると、コンパイルプロセスによって空のmain.out.xmlファイルが生成されます。私はそれが何であるか、その目的を知らない。

エラー:アンドロイド2.3.3 APIレベル:

[2011-12-30 16:10:02 - Hello Razor] res\layout\main.xml:0: error: Resource entry main is already defined. [2011-12-30 16:10:02 - Hello Razor] res\layout\main.out.xml:0: Originally defined here. [2011-12-30 16:10:02 - Hello Razor] C:\Users\Dux69\workspace\Hello Razor\res\layout\main.out.xml:1: error: Error parsing XML: no element found [2011-12-30 16:10:13 - Hello Razor] Error in an XML file: aborting build.

私のプロジェクトは、プラットフォーム用のセットアップで10

それは違いかを行う場合、私は知らないが、私は使用していますAndroidの仮想デバイスではなく、アプリケーションを実行/デバッグするための私のAndroid Incredible。必要以上の情報があれば教えてください。すぐに投稿します。

main.xml

<?xml version="1.0" encoding="utf-8"?> 
<TextView xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/textview" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" 
android:text="@string/hello_O" /> 

のstrings.xml

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
<string name="hello_O">Baba in the house, Razor Activity!</string> 
<string name="app_name">Hello Razor App</string> 
</resources> 

razorActivity.java

package hello.Razor; 

import android.R; 
import android.app.Activity; 
import android.os.Bundle; 

    public class razorActivity extends Activity 
    { 
     /** Called when the activity is first created. */ 
     @Override 
     public void onCreate(Bundle savedInstanceState) 
     { 
      super.onCreate(savedInstanceState); 
      setContentView(R.layout.main); 
     } 
    } 

答えて

1

I:ここで

は、私が使用している3つのコードファイルですかつて同様の問題があった。

プロジェクトの再構築/クリーニングとEclipseの再起動が私にとって助けになりました。

4

プロジェクトビューでmain.out.xmlを削除し、私が得たアンドロイドアプリケーションとして再実行

+0

が動作しない場合は、main.out.xmlを削除し、Cleanを実行してから、razorActivity.javaを開いて再実行してください。それは一般的なaaptのエラーです –

+0

助けのためにうわーありがとう。私は日食をシャットダウンし、それを再度開き、そのファイルを削除し、そしてそれから掃除するという全過程を経なければならない。面倒な人。とにかくこれを解決できるのでしょうか? – DuxClarus

+0

初めてXMLファイルを実行していたアプリケーションを "実行"しようとしましたが(私はあなたが理解しているeclipseからの奇妙な動作です)、アプリケーションを実行するとXMLファイルが何度も起動しますあなたの履歴が実行されます..あなたのrazorActivity.javaを開き、実行 - >実行履歴から起動し、最終的には永久に修正する必要があります –

1

エラーメッセージ:

Error:(43) Error parsing XML: no element found 

Error:Execution failed for task ':app:processDebugResources'. 

com.android.ide.common.process.ProcessException: Failed to execute aapt

ソリューション:私の場合、プロジェクトactivity_main.xmlはコード

01で開始されます
<?xml version="1.0" encoding="utf-8"?> 
<android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="com.example.batvibes.battybirthday.Main1Activity"> 

と次の終了タグを忘れました。

</android.support.constraint.ConstraintLayout> 

免責事項:私は全く新しいアンドロイドの開発です。私の提案は、すべてのタグの開閉を確認し、デバッグの次のステップに進んでください。

関連する問題