5

When I upgraded Android Studio 1.5.1 to Play Services Rev. 29, the main activity (as well as the Android Manifest) in my existing project was auto-updated to include the App Indexing boilerplate code. The unaltered boilerplate code then caused an exception in onStart of the activity (which is when I realized it had been added). I'm in the middle of production code development & am unwilling to divert.

How do I prevent this auto-generation in the future?

This question is similar to the question: What is the new generated code “This was auto-generated to implement the App Indexing API.”?

However, I don't care "what it is" right now - I want it not to darken my door next time I upgrade Android Studio.

Thanks!

ahandyapp
  • 51
  • 2
  • 4
  • 2
    How exactly did you update the library? Updating the dependency in your Gradle build file will not modify your existing code. – Bryan Herbst Dec 30 '15 at 14:32
  • 1
    Android Studio showed the "Platform and Plugin Updates" notification. I selected Update which brought up the update dialog. I choose "Exit Studio and Launch SDK Manager". After the update completed, I re-launched Studio but the "Platform and Plugin Updates" notification re-appeared. Then again after selecting Update, I choose the "Attempt to install packages." which ran to completion. I didn't manually edit the Gradle build files. – ahandyapp Dec 31 '15 at 23:28
  • We just ran into the same thing as well, almost the same steps you just outlined here. It ended up injecting all of this into our project as well, and we had to go through and strip it all out. I wonder if this is related to [this issue here](https://stackoverflow.com/questions/35063889/build-gradle-dependencies-auto-updates-itself/) with the build.gradle file having its support library dependencies updated (even when they were manually set). This kind of "smart update" stuff can be helpful, but also rather annoying when you don't know when/why it is turned on. I'd rather just be prompted. – Android3000 Mar 17 '16 at 16:34

1 Answers1

3

Today I recognized the same issue. Maybe it is up to the plugin called "Google App Indexing". I deactivated this plugin right now and hope that will never modify my code on his own.

File -> Settings -> Plugins -> uncheck "Google App Indexing"

I do not now if the plugin is the real reason but I think it is worth a try. For what that App Indexing is you could take a look to this page:

https://developers.google.com/app-indexing/android/publish

Community
  • 1
  • 1
Michael S.
  • 33
  • 7