3

I am working on the Bluetooth Chat from the Android Developer site in Eclipse IDE. I am using Android 2.1 and changed the Action Bar to display Toast messages instead and am only working with Secure connections.

I have three classes under the same package called BluetoothChat, BluetoothChatService, and DeviceListActivity and the project name is BluetoothCh.

Two of the files had errors that I fixed. They were saved and are clear of the red x that previously marked both .java files. All of the other files are clear of errors as well. However, the main Android project folder still contains a red x, and Eclipse is not allowing a run or debug of the application because of errors in the project.

Does anyone have any ideas how to solve this? Any advice is very much appreciated! Thank you!

Mat
  • 202,337
  • 40
  • 393
  • 406
Angelina
  • 31
  • 1
  • 2

3 Answers3

4
  1. Refresh the project then clean the project.
  2. Delete the error in the "Problems" tab.
  3. Right click the project->Android->Clean project properties (or whatever it is).
Haphazard
  • 10,900
  • 6
  • 43
  • 55
  • Where may I find the "Problems" tab? – Angelina Jun 22 '11 at 15:25
  • 2
    Eclipse->Window->Show View->Problems. It should pop in at the bottom. – Haphazard Jun 22 '11 at 15:28
  • Just found the Problems tab. But after cleaning my project it now says that R cannot be resolved as a variable, for instance, when I get strings from different files by R.string.title_connecting. When I import R (android) then it does not recognize my xml files and id's. Any advice? Thank you for all of the help! – Angelina Jun 22 '11 at 15:31
  • Once you fix the original problem the R should be regenerated (though, you may have to refresh the project to trigger it). Does the Problems tab tell you what the original problem is? – Haphazard Jun 22 '11 at 15:34
  • In the Console I am receiving two main errors several times including:[2011-06-22 08:14:30 - BluetoothChat] W/ResourceType( 5768): Bad XML block: header size 62 or total size 0 is larger than data size 0 AND [2011-06-22 08:14:30 - BluetoothChat] C:\Documents and Settings\shudya1\workspace\BluetoothChat\res\menu\option_menu.xml:3: error: No resource identifier found for attribute 'showAsAction' in package 'android' – Angelina Jun 22 '11 at 15:39
  • Google found this: http://stackoverflow.com/questions/5260686/no-resource-identifier-found-for-attribute-showasaction-in-package-android – Haphazard Jun 22 '11 at 15:44
  • Thank you! I am currently in the middle of debugging the application, since the application is not successfully connecting to another device. Hopefully I will be able to find the root of this error in debugging. Thank you for all of your time and help! – Angelina Jun 22 '11 at 16:32
  • @Angelina If this answered your question, please click the checkmark beside my answer to tell others that this is the accepted reply. – Haphazard Jun 22 '11 at 16:43
0

Clean the project and rebuild it see if the X mark still persists.

Deva
  • 3,919
  • 1
  • 27
  • 38
0

"When I clean the project it now gives me errors that R cannot be resolved as a variable. Where should I go from here?"

It sounds like you have an error in your code somewhere. You need to find out where the error is (what file and line) and fix it. This can be done with the problems tab in eclipse. It should tell you the description, file, path, line, and type of error you are getting.

Nick DeFazio
  • 2,412
  • 27
  • 31