-2

Yesterday I updated my eclipse. Before I update the eclipse, my application ran correctly but after I updated the eclipse when I run the application,I have an error,

MY LOGCAT

11-02 04:50:32.548: D/AndroidRuntime(2161): Shutting down VM 11-02 04:50:32.548: W/dalvikvm(2161): threadid=1: thread exiting with uncaught exception (group=0x40a71930) 11-02 04:50:32.609: E/AndroidRuntime(2161): FATAL EXCEPTION: main 11-02 04:50:32.609: E/AndroidRuntime(2161): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vindypratama.tempatwisata/com.vindypratama.tempatwisata.MainMapActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.app.ActivityThread.access$600(ActivityThread.java:141) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.os.Handler.dispatchMessage(Handler.java:99) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.os.Looper.loop(Looper.java:137) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.app.ActivityThread.main(ActivityThread.java:5041) 11-02 04:50:32.609: E/AndroidRuntime(2161): at java.lang.reflect.Method.invokeNative(Native Method) 11-02 04:50:32.609: E/AndroidRuntime(2161): at java.lang.reflect.Method.invoke(Method.java:511) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 11-02 04:50:32.609: E/AndroidRuntime(2161): at dalvik.system.NativeStart.main(Native Method) 11-02 04:50:32.609: E/AndroidRuntime(2161): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class fragment 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.app.Activity.setContentView(Activity.java:1881) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.vindypratama.tempatwisata.MainMapActivity.onCreate(MainMapActivity.java:25) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.app.Activity.performCreate(Activity.java:5104) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) 11-02 04:50:32.609: E/AndroidRuntime(2161): ... 11 more 11-02 04:50:32.609: E/AndroidRuntime(2161): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4030500 but found 0. You must have the following declaration within the element: 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.google.android.gms.maps.internal.q.v(Unknown Source) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.google.android.gms.maps.internal.q.u(Unknown Source) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.google.android.gms.maps.SupportMapFragment$b.cE(Unknown Source) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.google.android.gms.dynamic.a.a(Unknown Source) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.google.android.gms.dynamic.a.onInflate(Unknown Source) 11-02 04:50:32.609: E/AndroidRuntime(2161): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:290) 11-02 04:50:32.609: E/AndroidRuntime(2161): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676) 11-02 04:50:32.609: E/AndroidRuntime(2161): ... 21 more 11-02 04:50:45.858: I/Process(2161): Sending signal. PID: 2161 SIG: 9

My activity.java

package org.lucasr.twowayview;

import com.google.android.gms.common.ConnectionResult; 
import com.google.android.gms.common.GooglePlayServicesUtil; 
import com.google.android.gms.maps.CameraUpdateFactory; 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.SupportMapFragment; 
import com.google.android.gms.maps.model.LatLng;

import android.content.Context; 
import android.location.Criteria; 
import android.location.Location; 
import android.location.LocationManager; 
import android.os.Bundle; 
import android.support.v4.app.FragmentActivity; 
import android.support.v4.app.FragmentManager; 
import android.view.Menu;

public class MainMapActivity extends FragmentActivity 
{ 
    private GoogleMap map; 
    @Override 
    protected void onCreate(Bundle savedInstanceState) 
    { 
        super.onCreate(savedInstanceState); 
        setContentView(R.layout.activity_main_map); 
        setupMapIfNeeded(); 
    }

    private void setupMapIfNeeded() 
    {
        if(map == null) 
        { 
            FragmentManager fragmentManager = getSupportFragmentManager(); 
            SupportMapFragment supportMapFragment = (SupportMapFragment) fragmentManager.findFragmentById(R.id.maps); 
            map = supportMapFragment.getMap(); 
            if(map != null) 
            { 
                setupMap(); 
            } 
        } 
    } 
    private void setupMap() 
    { 
        map.setMyLocationEnabled(true); 
        moveToMyLocation(); 
    } 
    private void moveToMyLocation() 
    { 
        LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); 
        Criteria criteria = new Criteria();  
        location = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false)); 
        if ( location != null) 
        { 
            map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(), location.getLongitude()), 13)); 
        } 
    } 
    @Override public boolean onCreateOptionsMenu(Menu menu) 
    { 
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main_map, menu); 
        return true; 
    }

    protected void onResume() 
    { 
        super.onResume(); 
        int resCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()); 
        if( resCode != ConnectionResult.SUCCESS) 
        { 
            GooglePlayServicesUtil.getErrorDialog(resCode, this, 1);
        } 
    } 
}

Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.vindypratama.tempatwisata"
    android:versionCode="1"
    android:versionName="1.0" />
<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.vindypratama.tempatwisata.permission.MAPS_RECEIVE" />
<permission
    android:name="com.vindypratama.tempatwisata.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" >

</permission><uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyDcosD0fQsQcYCEiDDkRxP6ZRACPf-svaw" />

    <activity
        android:name="com.vindypratama.tempatwisata.MainMapActivity"
        android:label="@string/app_name" >

        <intent-filter>

            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application><manifest>

</manifest>

xml file:

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

kgandroid
  • 5,507
  • 5
  • 39
  • 69

2 Answers2

0

Try to use Project -> Clean. That actually helped me.
EDIT: If that doesn't help, try to relaunch Eclipse after Clean.

Vyacheslav Pukhanov
  • 1,788
  • 1
  • 18
  • 29
  • i have try to clean the project and try relaunch eclipse after clear but still can't resolved my project, thanks for your answer – Vindy Pratama Nov 02 '13 at 15:19
-1

you are using a custom class - twowayview. fix you build path. check if you have checked the added jars in your build path. clean the project. delete bin folder.clear/refresh the project. it will work

Rahul Gupta
  • 5,275
  • 8
  • 35
  • 66
  • thanks for your answer, i have tried but still cant resolved and when i try to delete the bin folder i get new error,,i have try make new project but still error,, sorry i'm newby for android program and sorry for my english because im not too understand speak english,, – Vindy Pratama Nov 02 '13 at 15:45
  • if you are a newbie in android, maybe you should go through google android developer documentation.if you read that, you will get to know android quite well..dont work on twowaylistview as yet.it is quite advanced for a newbee – Rahul Gupta Nov 02 '13 at 18:17
  • thanks for your suggestion, i will try learn in google android developper documentation – Vindy Pratama Nov 03 '13 at 12:59