Why does the Android app turn off when I add "android: id"?

I am writing an Android 2.3.3 application and testing it on my Samsung S3 phone. I added a custom view of the application for drawing a graph, and now when I try to run the application on my mobile phone, the program immediately crashes (without debugging information).

I highlighted the error in one line of code in the XML layout, namely:

android:id="@+id/graph" 

I have no other views in my project with this Id, so there should be no conflicts. I am developing using Netbeans 7.2 with the NBAndroid plugin on Windows 7 x64 and have not had any problems creating Android applications.

Here is a piece of code that causes a crash.

 <com.customApp.GraphView android:id="@+id/graph" android:layout_width="fill_parent" android:layout_height="40sp" /> 

Other notes:

  • Changing the identifier from the β€œchart” to something else does not help
+4
source share
1 answer

I was able to solve the problem by doing a "build clean" in NetBeans. The project builds and works as it is now.

I assume that one of the generated source files was not built properly. Well, thanks for the answers!

+3
source

All Articles