无法为我的 Android 应用程序提供互联网访问权限
我正在开发一个 Android 应用程序,我需要通过 GET 从网站获取流量,但我陷入了 Android 权限:
我在 Logcat 上收到此消息:
02-14 21:22:03.607: W/ActivityManager(51): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=***/.*** } from null (pid=-1, uid=-1) requires android.permission.ACCESS_NETWORK_STATE
而在我的清单中,< 之前有这些行code>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
我不明白问题是什么。
I'm working on an app for Android, I need to get a flux from a website via GET, but I'm stuck on Android Permissions :
I get this message on my Logcat :
02-14 21:22:03.607: W/ActivityManager(51): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=***/.*** } from null (pid=-1, uid=-1) requires android.permission.ACCESS_NETWORK_STATE
Whereas in my manifest there are those lines before the <application>
:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
I don't understand what the problem is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你到底把你的许可放在哪里了?
您使用过 Android Manifest xml 编辑器吗?
尝试执行清理/构建
Where exactly did you put your permission?
Did you use the Android Manifest xml editor?
try do perform a clean/build
我遇到了类似的问题 - 尝试直接从我的 FreeFoodApp 类(扩展应用程序)执行某些操作,在“onCreate()”方法中,编译器总是返回“无法从 null 开始意图...”
我将操作移至 LAUNCHER 活动,问题已解决:)
I've got similar issue - tried to do something directly from my FreeFoodApp class (extends Application), in the "onCreate()" method, the compiler always returned with "cant start intent ... from a null"
I moved the action to the LAUNCHER activity and it was resolved :)