android - 如何在 Android Studio : “This was auto-generated to implement the App Indexing API.” ? 中关闭新生成代码的自动更新

标签 android android-studio android-app-indexing

当我将 Android Studio 1.5.1 升级到 Play Services Rev. 29 时,我现有项目中的主要 Activity (以及 Android Manifest)会自动更新以包含 App Indexing 样板代码。未更改的样板代码随后在 Activity 的 onStart 中导致异常(当我意识到它已被添加时)。我正在生产代码开发中,我不愿意转移注意力。

以后如何防止这种自动生成?

这个问题类似于以下问题: 什么是新生成的代码“这是自动生成的以实现 App Indexing API。”?

但是,我现在不关心“它是什么”——我希望它不会在我下次升级 Android Studio 时让我的门变暗。

谢谢!

最佳答案

今天我发现了同样的问题。也许这取决于名为“Google App Indexing”的插件。我现在停用了这个插件,希望它永远不会自己修改我的代码。

文件 -> 设置 -> 插件 -> 取消选中“Google App Indexing”

我现在不知道插件是否是真正的原因,但我认为值得一试。对于 App Indexing 是什么,您可以查看此页面:

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

关于android - 如何在 Android Studio : “This was auto-generated to implement the App Indexing API.” ? 中关闭新生成代码的自动更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34531439/

相关文章:

android - Android 中的应用索引

android - 新生成的代码 "This was auto-generated to implement the App Indexing API."是什么?

iphone - 如何在 PhoneGap 应用程序内的页面之间导航?

android - 如何在不使用浏览器的情况下在我们的 Android 应用程序中显示网页内容

android - 无法在 Android Studio 上生成签名包

android-studio - 这个常量表达式的计算抛出一个表达式

android - 使用 camera2 API 捕获图片而不进行预览

java - 如何通过 Intent 将新数据添加到数组列表

Android Studio 在第二次构建后显示 Kotlin 依赖警告

android - 有没有人让 Firebase 应用索引工作?