【问题标题】:unfortunately android appname has stopped [duplicate]不幸的是android appname已停止[重复]
【发布时间】:2013-11-02 05:27:28
【问题描述】:

昨天我更新了我的日食。在我更新 eclipse 之前,我的应用程序运行正常,但是在我运行应用程序时更新了 eclipse 之后,我有一个错误,

我的 LOGCAT

11-02 04:50:32.548: D/AndroidRuntime(2161): 关闭 VM 11-02 04:50:32.548: W/dalvikvm(2161): threadid=1: 线程退出 未捕获的异常(组=0x40a71930)11-02 04:50:32.609: E/AndroidRuntime(2161):致命异常:主要 11-02 04:50:32.609: E/AndroidRuntime(2161): java.lang.RuntimeException: 无法启动 活动 组件信息{com.vindypratama.tempatwisata/com.vindypratama.tempatwisata.MainMapActivity}: android.view.InflateException:二进制 XML 文件第 7 行:错误 膨胀类片段 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 android.app.ActivityThread.access$600(ActivityThread.java:141) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 android.os.Handler.dispatchMessage(Handler.java:99) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 android.os.Looper.loop(Looper.java:137) 11-02 04:50:32.609: E/AndroidRuntime(2161):在 android.app.ActivityThread.main(ActivityThread.java:5041) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 java.lang.reflect.Method.invokeNative(Native Method) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 java.lang.reflect.Method.invoke(Method.java:511) 11-02 04:50:32.609: E/AndroidRuntime(2161):在 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 dalvik.system.NativeStart.main(本机方法)11-02 04:50:32.609: E/AndroidRuntime(2161):引起:android.view.InflateException: 二进制 XML 文件第 7 行:膨胀类片段时出错 11-02 04:50:32.609:E/AndroidRuntime(2161):在 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 android.view.LayoutInflater.inflate(LayoutInflater.java:489) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 android.view.LayoutInflater.inflate(LayoutInflater.java:396) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 android.view.LayoutInflater.inflate(LayoutInflater.java:352) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 android.app.Activity.setContentView(Activity.java:1881) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 com.vindypratama.tempatwisata.MainMapActivity.onCreate(MainMapActivity.java:25) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 android.app.Activity.performCreate(Activity.java:5104) 11-02 04:50:32.609:E/AndroidRuntime(2161):在 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) 11-02 04:50:32.609: E/AndroidRuntime(2161): ... 11 更多 11-02 04:50:32.609:E/AndroidRuntime(2161):原因: java.lang.IllegalStateException:应用程序中的元数据标记 AndroidManifest.xml 没有正确的值。预计4030500 但找到 0。您必须在 元素:11-02 04:50:32.609:E/AndroidRuntime(2161):在 com.google.android.gms.common.GooglePlayServicesUtil.n(未知来源) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(未知 来源)11-02 04:50:32.609:E/AndroidRuntime(2161):在 com.google.android.gms.maps.internal.q.v(未知来源)11-02 04:50:32.609:E/AndroidRuntime(2161):在 com.google.android.gms.maps.internal.q.u(未知来源)11-02 04:50:32.609:E/AndroidRuntime(2161):在 com.google.android.gms.maps.MapsInitializer.initialize(未知来源) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 com.google.android.gms.maps.SupportMapFragment$b.cE(未知来源) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 com.google.android.gms.maps.SupportMapFragment$b.a(未知来源) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 com.google.android.gms.dynamic.a.a(未知来源)11-02 04:50:32.609: E/AndroidRuntime(2161):在 com.google.android.gms.dynamic.a.onInflate(未知来源)11-02 04:50:32.609:E/AndroidRuntime(2161):在 com.google.android.gms.maps.SupportMapFragment.onInflate(未知 来源)11-02 04:50:32.609:E/AndroidRuntime(2161):在 android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:290) 11-02 04:50:32.609: E/AndroidRuntime(2161): 在 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676) 11-02 04:50:32.609: E/AndroidRuntime(2161): ... 21 更多 11-02 04:50:45.858:I/Process(2161):发送信号。 PID:2161 SIG:9

我的活动.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 文件:

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

【问题讨论】:

  • 请选择所有 myActivity 类并按 Ctrl+k

标签: java android eclipse google-maps android-intent


【解决方案1】:

尝试使用Project -&gt; Clean。这实际上帮助了我。
编辑:如果这没有帮助,请尝试在 Clean 之后重新启动 Eclipse。

【讨论】:

  • 我已尝试清理项目并尝试在清除后重新启动 eclipse 但仍然无法解决我的项目,感谢您的回答
【解决方案2】:

您正在使用自定义类 - twowayview。修复你的构建路径。检查您是否检查了构建路径中添加的 jar。清理项目。删除 bin 文件夹。清除/刷新项目。它会工作

【讨论】:

  • 感谢您的回答,我已尝试但仍无法解决,当我尝试删除 bin 文件夹时出现新错误,我尝试创建新项目但仍然错误,对不起安卓程序的新手,对不起我的英语,因为我不太懂说英语,
  • 如果你是 android 新手,也许你应该阅读 google android 开发者文档。如果你读过,你会很好地了解 android..不要在 twowaylistview 上工作。它是对于新手来说相当先进
  • 感谢您的建议,我会尝试在 google android developer 文档中学习
猜你喜欢
  • 2014-07-25
  • 1970-01-01
  • 2014-01-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-08-17
  • 1970-01-01
相关资源
最近更新 更多