【问题标题】:I have followed google map tutorial but keep on getting this answer:Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY我遵循了谷歌地图教程,但继续得到这个答案:安装错误:INSTALL_FAILED_MISSING_SHARED_LIBRARY
【发布时间】:2013-07-18 18:09:32
【问题描述】:

我一直在关注关于谷歌地图的教程,这里是一个非常基本的教程http://umut.tekguc.info/en/content/google-android-map-v2-step-step,我无法在模拟器上运行应用程序,iv 下载并安装了 vend.apk 和 gms.apk 文件以及已从 SDK 管理器下载了 google play 服务。在完成所有这些之后,当我最终在模拟器上运行我的应用程序时,出现以下错误: “安装错误:INSTALL_FAILED_MISSING_SHARED_LIBRARY”。

我也尝试过更改 AVD,但它不起作用。我认为我无法使用 AVD 正确配置 API。任何帮助将不胜感激,谢谢大家。 这是我的代码: MainActivity.java:

package com.example.googlemapsandroidv2;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

  public class MainActivity extends Activity {

private GoogleMap mMap;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mMap=((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
    mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
    final LatLng CIU=new LatLng(35.21843892856462, 33.41662287712097);
    Marker ciu=mMap.addMarker(new MarkerOptions().position(CIU).title("My Office"));
}

@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, menu);
    return true;
}

 } 

这是清单:

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.example.googlemapsandroidv2"
      android:versionCode="1"
      android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="17" />

 <permission
    android:name="com.example.googlemapsandroidv2.permission.MAPS_RECEIVE"
    android:protectionLevel="signature"></permission>


 <uses-permission
    android:name="com.example.googlemapsandroidv2.permission.MAPS_RECEIVE"/>
<uses-permission
    android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<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-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="AIzaSyCLhVm6faqwv8gaj1aWZ_Xvlsf4sMal42U"/>
         <uses-library
    android:name="com.google.android.maps" />
    <activity
        android:name="com.example.googlemapsandroidv2.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>

以下是有关 AVD 的详细信息: 目标:Android 4.0(API 级别 14) CPU/ABI:ARM(armeabi-v7a)

这是我在控制台上得到的:

[2013-07-18 14:27:31 - GoogleMapsAndroidV2] Android Launch!
[2013-07-18 14:27:31 - GoogleMapsAndroidV2] adb is running normally.
[2013-07-18 14:27:31 - GoogleMapsAndroidV2] Performing com.example.googlemapsandroidv2.MainActivity activity launch
[2013-07-18 14:27:31 - GoogleMapsAndroidV2] Automatic Target Mode: launching new emulator with compatible AVD 'MapTestAvd'
[2013-07-18 14:27:31 - GoogleMapsAndroidV2] Launching a new emulator with Virtual Device 'MapTestAvd'
[2013-07-18 14:27:33 - GoogleMapsAndroidV2] New emulator found: emulator-5554
[2013-07-18 14:27:33 - GoogleMapsAndroidV2] Waiting for HOME ('android.process.acore') to be launched...
[2013-07-18 14:28:29 - GoogleMapsAndroidV2] HOME is up on device 'emulator-5554'
[2013-07-18 14:28:29 - GoogleMapsAndroidV2] Uploading GoogleMapsAndroidV2.apk onto device 'emulator-5554'
[2013-07-18 14:28:40 - GoogleMapsAndroidV2] Installing GoogleMapsAndroidV2.apk...
[2013-07-18 14:29:26 - GoogleMapsAndroidV2] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2013-07-18 14:29:26 - GoogleMapsAndroidV2] Please check logcat output for more details.
[2013-07-18 14:29:26 - GoogleMapsAndroidV2] Launch canceled!
[2013-07-18 14:34:40 - SDK Manager] Warning: Ignoring add-on 'addon-google_apis-google-14': File not found: manifest.ini
[2013-07-18 14:37:09 - SDK Manager] Warning: Ignoring add-on 'addon-google_apis-google-14': File not found: manifest.ini
[2013-07-18 14:54:40 - SDK Manager] Warning: Ignoring add-on 'addon-google_apis-google-14': File not found: manifest.ini

感谢大家的宝贵时间。我非常感谢各种帮助。

【问题讨论】:

  • 我建议你尝试在设备上测试它。不确定 vending.apk 和 gms 将在模拟器上工作多远
  • 非常感谢您,先生,我会尝试这样做:)

标签: java android avd


【解决方案1】:

确保创建和使用带有“Google API”目标的 AVD。

否则将找不到谷歌地图。

如果您的目标列表中没有该选项,请确保您已从 SDK 管理器下载该选项。

【讨论】:

  • 我这样做了,并且 iv 检查了 sdk 管理器、谷歌播放服务以及版本 14 15 16 17 的谷歌 API,因为我已经更改了配置,不,我得到了这在 logcat:07-19 11:34:49.697: D/dalvikvm(652): 没有后期启用 CheckJNI (已经在) 07-19 11:34:51.027: W/GooglePlayServicesUtil(652): Google Play 服务是失踪。 07-19 11:34:51.046:W/GooglePlayServicesUtil(652):缺少 Google Play 服务。 07-19 11:34:51.056: W/GooglePlayServicesUtil(652): Google Play
  • 您需要使用 4.2.2+。在这里查看:developer.android.com/google/play-services/setup.html“只有 Android 4.2.2 及更高版本的 Google API 平台包含 Google Play 服务。”
猜你喜欢
  • 1970-01-01
  • 2021-11-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-23
  • 2012-01-27
  • 2018-03-14
  • 2022-10-15
相关资源
最近更新 更多