Fatal Exception: Main Java.lang.runtimeexception: Unable To Start Activity Componentinfo
Solution 1:
You are trying to import existing project into library. You should be importing the library using following method.
- Right click package explorer. Import -> Expand Android -> Existing Android Code Into Workspace.
- Select the google-play-services library. And check the copy to workspace checkbox.
Once this is done. Reference the library project
Right click on the project. Select Android in the left pane. In the right pane bottom you would see a frame with label Library. Click on add and add the imported library.
To add support library to your project: Right click on the project Androids Tools -> Add Support library.
If you decide to use support libraries you will have to replace the code
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"class="com.google.android.gms.maps.MapFragment" />
with
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"class="com.google.android.gms.maps.SupportMapFragment" />
also in your java file you will have to use SupportMapFragment.
mMap = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map)).getMap();
Solution 2:
Make sure that you are using Google APIs in the project build target. Go to project Properties > Android to check this.
Solution 3:
Are you using the correct API (GOOGLE API) in Eclipse? Make sure to use the GOOGLE APIs if you want to use google maps in android!
Solution 4:
You are probably having an import problem. Just check in right click on project -> properties -> Java build path
you have imported the libs. See this link for clarity
Solution 5:
This error is usually derived from incorrect referencing of google-play-services
library.
To do it correctly please follow the first 3 steps of this blog post guide I wrote on integrating Google Maps API V2 in your application:
Post a Comment for "Fatal Exception: Main Java.lang.runtimeexception: Unable To Start Activity Componentinfo"