How to remove a permission added because of Google Fitness API 7.5.0

百般思念 提交于 2019-12-06 02:47:56

问题


After updating my play-services-fitness api from 7.0.0 to 7.5.0 I noticed that when I go to upload a new build to the PlayStore it tells me that I am adding a new permission and 2 new features. I did not do this! What the heck.


回答1:


After doing some research to pin down the culprit it was in fact play-services-fitness:7.5.0 that was to blame. By including that in your project (compile 'com.google.android.gms:play-services-fitness:7.5.0') and compiling it will inject the <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> into your AndroidManifest.xml. So the PlayStore is correct, you are asking to use new permissions and features. You can confirm this by checking your build/intermediaries/manifests/full/[debug|release]/AndroidManifest.xml file. There you will see the new permission added. To remove this you simply add <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove" /> to your own manifest and it will be stripped out during the manifest merge process. You will crash if/when you do use a Fitness API that requires that permission but if you can guarantee that you won't use it then there you have it.



来源:https://stackoverflow.com/questions/30813821/how-to-remove-a-permission-added-because-of-google-fitness-api-7-5-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!