Android的 - 在导入时删除R.java文件,谷歌,播放服务,LIB [英] Android - Deletes R.java file when importing google-play-services-lib

查看:157
本文介绍了Android的 - 在导入时删除R.java文件,谷歌,播放服务,LIB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作中,我想展示一个地图一个项目中,我要添加谷歌播放服务LIB 但是当我添加我 R.java 被删除,并没有得到再生的文件。

我尝试添加谷歌播放服务LIB 到构建路径。加入后,一切都OK。但是,当我运行该项目它给出了一个错误说, java.lang.NoClassDefFoundError的:com.google.android.gms.R $设置样式

当我将其添加到项目中, R.java 被删除。我试着排列组合,我发现谷歌 SO 的数量。但是,有没有可行的解决方案,解决了我的问题。

请帮我出这个.. !!

修改

 < XML版本=1.0编码=UTF-8&GT?;
< RelativeLayout的的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT
>

<片段
 机器人:ID =@ + ID / map_gle
 机器人:layout_width =match_parent
 机器人:layout_height =match_parent
 类=com.google.android.gms.maps.SupportMapFragment/>

< / RelativeLayout的>
 

解决方案

确保您的谷歌播放服务是present在同一个工作目录,使这个项目作为参照原始项目。

 确保您拥有的谷歌播放服务安装最新版本(V2)。

选择Window> Android的SDK管理器或运行Android在命令行。
滚动到软件包列表的底部,并选择附加功能>谷歌Play业务。在谷歌Play业务SDK下载到您的计算机和AT&LT安装在你的Andr​​oid SDK的环境; Android的SDK文件夹> /演员/谷歌/ google_play_services /

加入谷歌游戏服务项目到Eclipse的工作空间。

点击文件 - >导入...,选择Android的 - >现有的Andr​​oid code到工作区
浏览并选择< Android的SDK文件夹> /演员/谷歌/ google_play_services / libproject /谷歌播放services_lib

要添加依赖关系谷歌播放服务到项目

项目 - >属性 - > Android的 - >图书馆,添加 - >谷歌播放的,services_lib
 

提供了链接可以看到谷歌导入播放服务

甚至检查你的谷歌播放服务是最新的通过将SDK经理...

I am working on a project in which I want to show a Map, for that I want to add google-play-service-lib but when I add it my R.java files gets deleted and not getting regenerated.

I tried adding google-play-service-lib into build path. After adding everything goes ok. But, when I run the project it gives an error says, java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable

And when I add it into the project, R.java gets deleted. I tried number of permutations and combinations which I found on google and SO. But there is no feasible solution, which solves my problem.

Please help me out for this..!!

EDIT

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

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

</RelativeLayout>

解决方案

making sure your Google play services is present in same working directory and make this project as a reference to the original project..

 Ensure you have the latest version (v2) of the Google Play Services installed.

Select Window > Android SDK Manager or run android at the command line.
Scroll to the bottom of the package list and select Extras > Google Play services. The Google Play services SDK is downloaded to your computer and installed in your Android SDK environment at <android-sdk-folder>/extras/google/google_play_services/

Add the Google Play Services project into your Eclipse workspace.

Click File -> Import..., select Android -> Existing Android Code into Workspace
Browse to and select <android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib

To add the dependency to Google Play Services into your project

Project -> Properties -> Android -> Library, Add -> google-play-services_lib

Providing the link you can see the importing Google play services

and even check your google play services is up to date by going to sdk manger...

这篇关于Android的 - 在导入时删除R.java文件,谷歌,播放服务,LIB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆