从Android Studio中的应用中删除Google Play服务 [英] Remove Google Play Services from app in Android Studio

查看:1543
本文介绍了从Android Studio中的应用中删除Google Play服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Android Studio中的一个示例应用程序,并且我不小心将Google Play服务添加到了我的某个活动中。我甚至不知道我是如何做到的,但它添加了几个自动生成的方法,变量和导入。我删除了所有这些,并继续在应用程序上工作。现在,几天后,我发现

I am working on an example app in Android Studio and I somehow accidentally added Google Play Services to one of my Activities. I'm not even sure how I did it, but it added several auto generated methods, variables and imports. I removed all of these and continued to work on the app. Now, a few days later, I found

    compile 'com.google.android.gms:play-services-appindexing:8.1.0'

在我的 app / build.gradle 脚本和我的清单文件中自动生成的块:

in my app/build.gradle script and an auto-generated chunk in my manifest file:

<!--
     ATTENTION: This was auto-generated to add Google Play services to your project for
     App Indexing.  See https://g.co/AppIndexing/AndroidStudio for more information.
-->
<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

< application> 标记下。当我删除它们并构建项目时,清单中将重新生成< meta-data> 标记,这会导致构建失败,因为我在构建中删除了依赖项。 gradle。

under the <application> tag. When I remove them and build the project, the <meta-data> tag is regenerated in the manifest, which causes the build to fail since I removed the dependency in build.gradle.

如何从应用程序中完全删除Google Play服务并构建系统以停止此操作?我错过了什么?

How do I completely remove Google Play Services from the app and build system to stop this? What have I missed?

推荐答案

它只是建议不是解决方案,因为我不知道您的完整场景。删除应用程序中的所有依赖关系和所有构建文件夹并重建项目。至少它会提示您播放服务依赖项的位置

It just suggestion not a solution as I don't know your complete scenario. Delete all dependencies and all the build folders from your application and rebuild the project.At least It will prompt you where the play services dependency is present

希望它可以工作

这篇关于从Android Studio中的应用中删除Google Play服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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