Android map v2 api és emuláto hiba

Android map v2 api és emuláto hiba
2013-12-16T23:20:44+01:00
2013-12-19T20:50:06+01:00
2022-11-30T05:45:36+01:00
mikkamakka21
Sziasztok!

Már több napja szívok azzal, hogy az elkészített android app (V2)-őt el tudjam indítani emulátoron. De sajna eddig telefonon sem sikerült.

Leírnám akkor ami megvan eddig:

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.testmapv2" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <permission android:name="com.example.testmapv2.permission.MAPS_RECEIVE" android:protectionLevel="signature" > </permission> <uses-permission android:name="com.example.testmapv2.permission.MAPS_RECEIVE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> <uses-feature android:glEsVersion="0x00020000" android:required="true" > </uses-feature> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.example.testmapv2.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> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my key" /> </application> </manifest>

activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <fragment android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent" /> </RelativeLayout>

MainActivity.java

package com.example.testmapv2; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; public class MainActivity extends FragmentActivity { private GoogleMap map; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); map = ((SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map)).getMap(); map.setMapType(GoogleMap.MAP_TYPE_NORMAL); } }

Amit megcsináltam:

- google-play-services_lib -> be van linkelve
- az emulátort létrehoztam: Target: Android 2.3.3 - API Level 10
- az emulátorra telepítettem ezeket az állományokat -> MediaFire
-> com.android.vending-4.3.11.apk
-> com.google.android.apps.maps-7.0.0-700002504.apk
-> com.google.android.gms.apk
- GoogleCloud Console -ba (V2) kulcs megyvan

Ezek után sehogy sem tudom az appot életre kelteni, mert a következő hibával elszáll. Számtalan példát kipróbáltam már a neten,de egyik sem ment.

HIBA: (The application Test Map v2 has stopped unexpectedly. Please try again.)

12-16 22:13:41.459: E/AndroidRuntime(1120): FATAL EXCEPTION: main 12-16 22:13:41.459: E/AndroidRuntime(1120): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testmapv2/com.example.testmapv2.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class fragment 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.os.Handler.dispatchMessage(Handler.java:99) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.os.Looper.loop(Looper.java:123) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.app.ActivityThread.main(ActivityThread.java:3683) 12-16 22:13:41.459: E/AndroidRuntime(1120): at java.lang.reflect.Method.invokeNative(Native Method) 12-16 22:13:41.459: E/AndroidRuntime(1120): at java.lang.reflect.Method.invoke(Method.java:507) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-16 22:13:41.459: E/AndroidRuntime(1120): at dalvik.system.NativeStart.main(Native Method) 12-16 22:13:41.459: E/AndroidRuntime(1120): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class fragment 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:587) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.view.LayoutInflater.inflate(LayoutInflater.java:408) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.app.Activity.setContentView(Activity.java:1657) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.example.testmapv2.MainActivity.onCreate(MainActivity.java:16) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 12-16 22:13:41.459: E/AndroidRuntime(1120): ... 11 more 12-16 22:13:41.459: E/AndroidRuntime(1120): 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 <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.google.android.gms.maps.internal.q.v(Unknown Source) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.google.android.gms.maps.internal.q.u(Unknown Source) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.google.android.gms.maps.SupportMapFragment$b.cE(Unknown Source) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.google.android.gms.dynamic.a.a(Unknown Source) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.google.android.gms.dynamic.a.onInflate(Unknown Source) 12-16 22:13:41.459: E/AndroidRuntime(1120): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279) 12-16 22:13:41.459: E/AndroidRuntime(1120): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)

Előre is köszönöm szépen a SEGÍTSÉGET!
Szép napot!

D
Mutasd a teljes hozzászólást!

Tetszett amit olvastál? Szeretnél a jövőben is értesülni a hasonló érdekességekről?
abcd