简体   繁体   English

Android(Eclipse)找不到google-play-services_lib.apk尝试了多种解决方案

[英]Android (Eclipse) cannot find google-play-services_lib.apk tried multiple solutions

I am creating an android application that displays a map based on the Google maps API, which should be compatible with android 2.3 API level 10. 我正在创建一个显示基于Google Maps API的地图的android应用程序,该应用程序应与android 2.3 API 10级兼容。

I have tried all the solutions i could come across such as: 我尝试了所有可能遇到的解决方案,例如:

  1. imported existing code into my project (checked copy to workspace and its the directory google-play-services-lib) 将现有代码导入我的项目(选中复制到工作区及其目录google-play-services-lib)
  2. added the correct meta and such in my XML (see below) 在我的XML中添加了正确的meta等(请参见下文)
  3. I have tried setting up the emulator with several different settings 我尝试使用几种不同的设置来设置模拟器

The android application runs fine, but when this page is shown is exits. android应用程序运行正常,但显示此页面时退出。

Manifest.xml 的Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="dcs.aber.ac.uk.cs211.group02"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="22" />

    <permission
        android:name="dcs.aber.ac.uk.cs211.group02.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />


    <!-- Accessing camera hardware -->
    <!-- putting android.hardware.camera prevents non-camera devices using this app -->
    <uses-feature android:name="android.hardware.camera" />
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />
    <uses-permission android:name="dcs.aber.ac.uk.cs211.group02.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="dcs.aber.ac.uk.cs211.group02.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:logo="@drawable/ic_launcher"
        android:theme="@style/AppTheme" >
        <activity
            android:name="dcs.aber.ac.uk.cs211.group02.StartScreen"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="dcs.aber.ac.uk.cs211.group02.CreateWalkActivity"
            android:label="@string/title_activity_create_walk" >
        </activity>
        <activity
            android:name="dcs.aber.ac.uk.cs211.group02.HelpScreen"
            android:label="@string/title_activity_help_screen" >
        </activity>
        <activity
            android:name="dcs.aber.ac.uk.cs211.group02.WalkRecording"
            android:label="@string/title_activity_walk_recording" >
        </activity>
    </application>

    <meta-data android:name="dcs.aber.ac.uk.cs211.group02.API_KEY"
        android:value="AIzaSyBKYpKfU4zn-3IBkskKsLbwRsQ1-IqFldk"
        />

    <meta-data android:name="com.google.android.gms.version"
           android:value="@integer/google_play_services_version" />

</manifest> 

The xml displaying the map: 显示地图的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:background="@color/black"
    tools:context=".WalkRecording" >

    <fragment
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:map="http://schemas.android.com/apk/res-auto"
        android:id="@+id/mapView"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>

the java code for the map class 地图类的Java代码

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;

public class WalkRecording extends FragmentActivity {

    private GoogleMap map;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_walk_recording);

        map=((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.mapView)).getMap();

        map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.walk_recording, menu);
        return true;
    }

}

The eclipse trace: 蚀痕:

[2013-11-22 23:03:07 - WalkingTours] ------------------------------
[2013-11-22 23:03:07 - WalkingTours] Android Launch!
[2013-11-22 23:03:07 - WalkingTours] adb is running normally.
[2013-11-22 23:03:07 - WalkingTours] Performing dcs.aber.ac.uk.cs211.group02.StartScreen activity launch
[2013-11-22 23:03:07 - WalkingTours] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'mapTestAPI16'
[2013-11-22 23:03:07 - WalkingTours] Uploading WalkingTours.apk onto device 'emulator-5554'
[2013-11-22 23:03:07 - WalkingTours] Installing WalkingTours.apk...
[2013-11-22 23:03:12 - WalkingTours] Success!
[2013-11-22 23:03:12 - google-play-services_lib] Could not find google-play-services_lib.apk!
[2013-11-22 23:03:12 - WalkingTours] Starting activity dcs.aber.ac.uk.cs211.group02.StartScreen on device emulator-5554
[2013-11-22 23:03:14 - WalkingTours] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=dcs.aber.ac.uk.cs211.group02/.StartScreen }

Seeing your error log, there is one solution provided in this link . 查看错误日志,此链接中提供了一种解决方案。 Dont import google-play-services_lib APK, you should reference it on your project as an Android Library Project. 不要导入google-play-services_lib APK,您应该在您的项目中将其作为Android Library Project引用。

I had the same problem. 我有同样的问题。 Look at project: Properties-> Java Build Path under projects remove google-play-services_lib. 查看项目:项目下的Properties-> Java Build Path删除google-play-services_lib。 Not necessary to include in build also as a project. 也不必作为项目包含在构建中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 google-play-services_lib Android在Eclipse上无限启动 - google-play-services_lib Android on Eclipse infinite launching 如果将google-play-services.jar lib添加到Eclipse中的helloworld android项目中,Android编译会冻结 - Android compilation freezes if google-play-services.jar lib is added into my helloworld android project in Eclipse 无法使用'com.google.android.gms构建APK:播放服务:9.4.0' - Cannot Build APK with 'com.google.android.gms:play-services:9.4.0' 我在哪里可以找到google-play-services_lib.jar? - Where can I find google-play-services_lib.jar? Google Play游戏服务:运行导出的apk时出现AbstractMethodError,但如果从Eclipse运行则可以正常运行 - Google Play Game Services: AbstractMethodError when run exported apk, while works ok if run from eclipse Google-play-services_lib的Jar不匹配 - Jar mismatch for google-play-services_lib Android Eclipse-找不到* .apk - Android Eclipse - Could not find *.apk Android:ANT版本因google-play-services-lib而失败:“解析为没有project.properties文件的路径” - Android: ANT build fails with google-play-services-lib: “resolve to a path with no project.properties file for project” android studio中的Google play服务 - Google play services in android studio 如果将Facebook SDK导入为现有的Android源代码,Facebook SDK将会崩溃google-play-services-lib - Facebook SDK crashes google-play-services-lib if imported as existing Android source code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM