Homepage | Tutorials | Blog
Handling Errors In AIDE
Deciphering Error Messages
As you develop apps with AIDE you are probably going to have coding errors. These errors by way of 'error messages' will present themselves when you 'build' the app code.
They will leave you perplexed, and at times frustrated; especially when you have to spend more than a few minutes trying to unravel their mystic. But don't get annoyed at these pesky messages of confusion; instead take heed and enjoy the challenge knowing that about 16 million app programmers are indulging in the same pitfalls as yourself.
Good News
The facts are:
Most app coding errors are more simple than complex;
App errors are usually the result of simple ommissions, misspelled words, mismatched pages, and code classes.
Code Perfect
Your code is probably flawless, but errors still occur. This page provides some basic insights into debunking coding errors in AIDE.
First know that if ten errors populate when you build your code most likely there is only one error. In programming, one mistake in code can throw off the other code which results in several or many unwanted errors at the same time. Unfortunately for us, we don't know which one is the actual culprit.
So you have to assess the errors and choose one that looks most obvious or easiest to understand. And, eliminate one error message at a time. After each error fix; make sure you Save the page and try to Build the app again. If you have found the culprit, error; your app should compile and build without issue.
Errors in AIDE, Examples
To give examples of coding errors we will include images so you can see the actual errors that have populated from known errors.
When there are errors at runtime; this is the message that displays.

In this error message; it is saying the error is at activity_main.xml, and that the string type , textStyle Bold, is not allowed. The actual error is the B in Bold, it should be lowercase - bold. Caps are not allowed in a value.

This next error is at the page MainActivity.java; and says 'activitymain' is an unknown member. This means it doesn't recognize the activitymain. The word was spelled incorrectly; should be 'activity_main'.

This next error is 'unknown entity'. It means it doesn't understand or recognize the Button. This error was caused because the Button import statement was not added. This error is an example of how one error can populate other error messages that really are not errors. 'B1' and 'unknown type of field' are in code connected to Button method and therefore look like errors but are not.

The next example is also an import statement error. 'Unknown entity toast', means it does not recognize the toast method. We are using a toast message in this code, but get an error because the toast import statement was not included at imports.

This image shows the Toast and Button imports included as they should be. We now see a 'no errors' message once we Save our page after adding them. We can now Run our app without issue.

Some Common Errors When Coding
Android
Here we list some more common 'errors in AIDE', when coding a variety of code classes.
File names that don't match the corresponding code in another page
Android Manifest - AppTheme incorrectly spelled or missing,
Android Manifest - code required like InternetPermissions,SDK min and Target versions, or Intent filters for additional app pages added,
R.id names - from layout file that don't match to the name in the java file, misspelled or capped,
Spelling - Capitalized words versus small capped words,
Java class pages - not camel cased; all java page names must be camel cased like: myappname.java - correct spelling is MyAppName.java,
Drawables - all images, drawables must be small letters only, not capped, and no dashes, underscores are allowed.
SDK target and min versions not matching the code implemented - check your APi level for a code your implementing
Images/xml pages put in wrong folder - example, for frame animation all images and xml files go in the res/drawable folder, however for view animation the
xml files must go in the anim folder, and images go in the drawable folder.
Also Read:
Import Statements Android
From The Web:
Get Photography Tips - Point and Shoot Cameras | Taste World Wines - Free Wine App
At Twitter
@codeAndroidApps