Saturday, 30 August 2014

android dialogfragment cannot be resolved to a type

solution:
Right click on your project folder -> Build path -> Configure build path -> Add External Jars(From libraries tab) -> select "android-support-v4.jar" file.
(It'll be located in Android SDK folder here is generic path "android-sdk\extras\android\support\v4").

Tuesday, 26 August 2014

java.lang.IllegalStateException: Could not execute method of the activity

Problem
Caused by: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist.

In my case i am missing "com.google.android.gms.version" in manifest file.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
Solution
paste the
             <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

java.lang.classnotfoundexception didn't find class on path dexpathlist

Got the following Error:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android.geofence/com.example.android.geofence.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.android.geofence.MainActivity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.example.android.geofence-5.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.android.geofence-5, /vendor/lib, /system/lib]]

solution:
  1. Right click on your project and select Properties.
  2. Select Java Build Path from the menu on the left.
  3. Select the Order and Export tab.
  4. From the list make sure the libraries or external jars you added to your project are checked.
  5. Finally, clean your project & run.
 

Type case expressions must be constant expressions android

Tip
You can quickly convert a switch statement to an if-else statement using Eclipse's quick fix.
Click on the switch keyword and press Ctrl + 1 then select
Convert 'switch' to 'if-else'.
http://spacetech.dk/android-case-expresssions-must-be-constant-expressions.html
http://tools.android.com/tips/non-constant-fields


Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'. Android AAPT Problem

Go to properties choose Android and choose latest android version.

Make sure you've set your target API (different from the target SDK) in the Project Properties (not the manifest) to be at least 4.0/API 14.

Monday, 25 August 2014

android library projects cannot be launched

Through the this steps you can setup android library projects:
  1. In Eclipse , Right Click on Project from Package Explorer.
  2. Select Properties,.
  3. Select Android from Properties pop up window,
  4. See "Is Library" check box,
  5. If it is checked then Unchecked "Is Library" check box.
  6. Click Apply and than OK.
I got this error after adding google play services to My eclipse.

The import android.support cannot be resolved

Please follow these Steps:
  1. Go to your Project's Properties
  2. Navigate to the Java Build Path
  3. Then go to the Libraries tab. There click the Add External JARs Button on the Right pane.
  4. Select the android-support-v4.jar file, usually the path for the Jar file is :
    YOUR_DRIVE\android-sdks\extras\android\support\v4\android-support-v4.jar 
  5. After adding andorid-support-v4.jar Library, navigate to the Order and Export tab and put check mark on the android-support-v4 Library file.
  6. After doing the above, Clean the Project and Build it.
  7. Problem Solved.