Sunday, 23 November 2014

Android java.lang.RuntimeException: Unable to instantiate activity ComponentInfo

You have put 3rd party library in library folder and reference them. Go to Properties/ Java Build Path/ Libraries/ Add External JARs.
Check the Jar files in the Properties/ Java Build Path/ Order and Export

Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 5108 (Thread-3126)

I am trying to open my application on clicking on notification. The app gets closed when i click on notification while it is running ie in foreground it shows "Unfortunately, App has stopped". upon clicking notification second time the app open perfectly. It throws the below error on clicking notification first time. Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 5108 (Thread-3126)

Adding android:launchMode="singleInstance" in manifest solved the problem. The issue is whenever i am trying to open the app by clicking notification the object is re created

you can have detailed log error at
  
http://stackoverflow.com/questions/26966374/opening-application-on-clicking-notification-shows-unfortunately-app-has-stopped 

Wednesday, 10 September 2014

Google-play-services_lib Unable to resolve target 'android-9

Problem :
   When trying to import   Google-play-services_lib to eclipse get the following error.
 
                     Google-play-services_lib Unable to resolve target 'android-9
Solution:
     Open the SDK Manager, click obsolete (so API 9 shows up), and grab API 9.I. Install API 9 packages.

Monday, 8 September 2014

Unexpected namespace prefix "xmlns" found for tag fragment

Problem:
     <fragment xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/map"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/spr_place_type"
        class="com.google.android.gms.maps.SupportMapFragment" />   

Solution:

Remove xmlns:android="http://schemas.android.com/apk/res/android" from the <fragment> element, and consider moving xmlns:map="http://schemas.android.com/apk/res-auto" from the <fragment> element to the root element.
For example, this is valid:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:map="http://schemas.android.com/apk/res-auto"
    android:id="@+id/foo"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <fragment
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.SupportMapFragment"
        map:mapType="satellite"/>

</RelativeLayout>

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.