Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

cassiombc

Android-Fatal Error

Recommended Posts

Galera estou iniciando o desenvolvimento em android e segui o passo a passo do Google sobre o uso de maps api no dese. para android.

 

Ao criar um projeto o nomeie, removendo o example.nomedoprojeto e após isso tive que criar o xml de layout e o activity feito isso configurei de acordo com o seguinte codigo :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <com.google.android.maps.MapView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/mapview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:apiKey="AIzaSyBtImlF-jbo_aT0DyP3CAtouI2OmHS95Qs"
        android:clickable="true" />

</LinearLayout>
package com.tracker;

import android.os.Bundle;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class MapaActivity extends MapActivity {

	public MapaActivity() {
		// TODO Auto-generated constructor stub
	}

	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}

	public void onCreate(Bundle savedInstanceState) {
		try {
			super.onCreate(savedInstanceState);
			setContentView(R.layout.activity_mapa);
			MapView mapView = (MapView) findViewById(R.id.mapview);
			mapView.setBuiltInZoomControls(true);
		} catch (RuntimeException e) {
			e.printStackTrace();
		}
	}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.tracker"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-permission android:name="android.permission.INTERNET" />

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <uses-library android:name="com.google.android.maps" >
        </uses-library>

        <activity
            android:name="com.tracker.MainActivity"
            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>

o emulador esta com a vers. de plataforma 4.4.2 e o projeto tb, so que não está rodando ele demora muito e nao roda. no logcat da fFATAL EXECPTION no main.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Galera o Erro que esta me demonstradnono lag cat é o seguinte:

02-17 19:04:26.897: W/dalvikvm(663): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
02-17 19:04:26.927: E/AndroidRuntime(663): FATAL EXCEPTION: main
02-17 19:04:26.927: E/AndroidRuntime(663): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mobtracker/com.mobtracker.TrackerActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class fragment
02-17 19:04:26.927: E/AndroidRuntime(663): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at android.os.Handler.dispatchMessage(Handler.java:99)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at android.os.Looper.loop(Looper.java:137)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at java.lang.reflect.Method.invokeNative(Native Method)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at java.lang.reflect.Method.invoke(Method.java:511)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-17 19:04:26.927: E/AndroidRuntime(663): 	at dalvik.system.NativeStart.main(Native Method)
02-17 19:04:26.927: E/AndroidRuntime(663): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class fragment

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.