Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Google Play Services from app in Android Studio

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'

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" />

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.

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

like image 727
rvb Avatar asked Jan 13 '16 05:01

rvb


People also ask

Can I remove Google Play Services from my Android?

Google Play Services isn't the same as the Google Play Store app, and is included with Android. Google Play Services doesn't make your battery drain faster or use too much of your mobile data plan. You can't force stop or uninstall Google Play services.

Can I uninstall Google Play services for AR?

If you don't use AR apps, you can uninstall Google Play Services for AR. On your Android device, open the device settings. Under “Apps & notifications,” find Google Play Services for AR. Tap Uninstall.

How do I stop Google Play Services from installing?

Google Play Services cannot be uninstalled on regular Android phones where Play Services was preinstalled. However, you can uninstall its updates by going to “Settings → Apps → System apps → Google Play Services.” Tap on the three-dot icon and select “Uninstall updates.” Restart your phone.


4 Answers

As @Chinmay stated, removing all references to Google Play Service/App indexing and deleting '<-path-android-project->/app/build' solved this for me, also.

Thanks

like image 69
Big Rich Avatar answered Nov 15 '22 20:11

Big Rich


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

Hope it will work

like image 32
Chinmay Avatar answered Nov 15 '22 19:11

Chinmay


Don't worry, it's easy. I had same problem and I resolved it, while deleting this line of source code from dependency.

I had installed latest Google Play Service in my Android Studio, but I was using the below line in dependency.

compile 'com.google.firebase:firebase-core:11.8.0'

Just remove this line if you are using it.

like image 26
Pir Fahim Shah Avatar answered Nov 15 '22 20:11

Pir Fahim Shah


It's simple

  • Click right on app -> Open Modules settings
  • Click Dependency tab
  • Select play-services line
  • and click delete (small minus on top right)

That's it

like image 39
azuldev Avatar answered Nov 15 '22 20:11

azuldev