This is a very common Exception. It causes your application to stop during the start or execution of your app. In the LogCat you see the message:
In this case, check if you have declared your activity in the AndroidManifest.xml file.
The simplest way to declare your Activity in AndroidManifest.xml is:
This error occurs because the app, when packaging, finds two .dex files that define the same set of methods.
Usually this happens because the app has accidentally acquired 2 separate dependencies on the same library.
For instance, say you have a project, and you want to rely on two libraries: A and B, which each have their own dependencies. If library B already has a dependency on library A, this error will be thrown if library A is added to the project by itself. Compiling library B already gave the set of code from A, so when the compiler goes to bundle library A, it finds library A's methods already packaged.
To resolve, make sure that none of your dependencies could accidentally be added twice in such a manner
The exception that is thrown when an application attempts to perform a networking operation on its main thread.
This is only thrown for applications targeting the Honeycomb SDK or higher. Applications targeting earlier SDK versions are allowed to do networking on their main event loop threads, but it's heavily discouraged.
Here's an example of a code fragment that may cause that exception:
Above code will throw NetworkOnMainThreadException for applications targeting Honeycomb SDK (Android v3.0) or higher as the application is trying to perform a network operation on the main thread.
To avoid this exception, your network operations must always run in a background task via an AsyncTask, Thread, IntentService, etc.
This is a runtime error that happens when you request a large amount of memory on the heap. This is common when loading a Bitmap into an ImageView.
You have some options:
Use a large application heap
Add the "largeHeap" option to the application tag in your AndroidManifest.xml. This will make more memory available to your app but will likely not fix the root issue.
Recycle your bitmaps
After loading a bitmap, be sure to recycle it and free up memory:
Load sampled bitmaps into memory
Avoid loading the entire bitmap into memory at once by sampling a reduced size, using BitmapOptions and inSampleSize.