2011-07-11 2 views
0

AndroidとBluetoothで何かをプレイするのは初めてのことです。だから私はandroid.com上の例をBluetoothChatしようとしたが、私はいくつかの問題があった。 LogCat出力ザッツBluetoothChat Androidの例ランタイムエラー

 
07-11 10:51:40.000: ERROR/AndroidRuntime(853): FATAL EXCEPTION: main 
07-11 10:51:40.000: ERROR/AndroidRuntime(853): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android.BluetoothChat/com.example.android.BluetoothChat.BluetoothChat}: java.lang.ClassNotFoundException: com.example.android.BluetoothChat.BluetoothChat in loader dalvik.system.PathClassLoader[/data/app/com.example.android.BluetoothChat-2.apk] 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at android.app.ActivityThread.access$1500(ActivityThread.java:117) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at android.os.Handler.dispatchMessage(Handler.java:99) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at android.os.Looper.loop(Looper.java:123) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at android.app.ActivityThread.main(ActivityThread.java:3683) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at java.lang.reflect.Method.invokeNative(Native Method) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at java.lang.reflect.Method.invoke(Method.java:507) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at dalvik.system.NativeStart.main(Native Method) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853): Caused by: java.lang.ClassNotFoundException: com.example.android.BluetoothChat.BluetoothChat in loader dalvik.system.PathClassLoader[/data/app/com.example.android.BluetoothChat-2.apk] 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at java.lang.ClassLoader.loadClass(ClassLoader.java:551) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561) 
07-11 10:51:40.000: ERROR/AndroidRuntime(853):  ... 11 more 
07-11 10:51:40.010: WARN/ActivityManager(133): Force finishing activity com.example.android.BluetoothChat/.BluetoothChat 
07-11 10:51:40.510: WARN/ActivityManager(133): Activity pause timeout for HistoryRecord{406a4340 com.example.android.BluetoothChat/.BluetoothChat} 

私はこれは本当に簡単なはず知っている、しかし、私は本当にそれを修正する方法は考えて、持っていません。 manfiestfileこの(そのorginal)のようになります。

<?xml version="1.0" encoding="utf-8"?> 
<!-- Copyright (C) 2009 The Android Open Source Project 

    Licensed under the Apache License, Version 2.0 (the "License"); 
    you may not use this file except in compliance with the License. 
    You may obtain a copy of the License at 

      http://www.apache.org/licenses/LICENSE-2.0 

    Unless required by applicable law or agreed to in writing, software 
    distributed under the License is distributed on an "AS IS" BASIS, 
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
    See the License for the specific language governing permissions and 
    limitations under the License. 
--> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
     package="com.example.android.BluetoothChat" 
     android:versionCode="1" 
     android:versionName="1.0"> 
    <uses-sdk minSdkVersion="6" /> 
    <uses-permission android:name="android.permission.BLUETOOTH" /> 
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> 

    <application android:label="@string/app_name" 
       android:icon="@drawable/app_icon" > 
     <activity android:name=".BluetoothChat" 
        android:label="@string/app_name" 
        android:configChanges="orientation|keyboardHidden"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity android:name=".DeviceListActivity" 
        android:label="@string/select_device" 
        android:theme="@android:style/Theme.Dialog" 
        android:configChanges="orientation|keyboardHidden" /> 
    </application> 
</manifest> 

ファイルの残りの部分は、あまりにも、orginalです。あなたが私を助けてくれることを願います。元のファイルをインポートできませんでしたので、新しいファイルを作成し、ディレクトリとmainfestファイルを置き換えました。多分問題があるかもしれません。

+0

私はパッケージ名を確認する必要があると思います。すべてが正確に同じであれば問題はないはずです。 – Hein

+0

プロジェクトのディレクトリ一覧を表示できますか? – Hein

答えて

0

クラスcom.example.android.BluetoothChat.BluetoothChatが見つかりません。 パッケージ名には既にBluetoothChatが含まれています。また、クラス名は大文字と小文字が区別されるので、クラスがパッケージcom.example.android.bluetoothchatにある場合は動作しません。

+0

では大文字と小文字が区別されません。パッケージはcom.example.android.BluetoothChatであり、4つのディレクトリがあり、最後にBluetoothChatはBluetoothChat.javaというファイルです。 Programmの名前はBluetoothChatです。 – fluxim

+0

あなたの答えに感謝します。 私はそれを修正しました。 eclipseのsrcディレクトリに明示的なパッケージはありませんでした。私はここで言葉を追加しただけです。 – fluxim

関連する問題