0
我想我的應用程序連接到互聯網,所以我把該權限檢查連接到互聯網和訪問網絡狀態: - 錯誤,同時訪問網絡狀態
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MovieManiac">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<user-permission android:name="android.permission.INTERNET"/>
<user-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<user-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
我已經嘗試了所有的解決方案以前發佈像再次添加用戶權限,也乾淨的構建,但似乎沒有任何工作。我使用的API 22.我真的很感激一些主動幫助錯誤我得到的是這樣的: -
FATAL EXCEPTION: main
Process: com.example.archit.moviemaniac, PID: 4638
java.lang.SecurityException: ConnectivityService: Neither user 10105 nor current process has android.permission.ACCESS_NETWORK_STATE.
at android.os.Parcel.readException(Parcel.java:1546)
at android.os.Parcel.readException(Parcel.java:1499)
at android.net.IConnectivityManager$Stub$Proxy.getActiveNetworkInfo(IConnectivityManager.java:964)
at android.net.ConnectivityManager.getActiveNetworkInfo(ConnectivityManager.java:610)
at com.example.archit.moviemaniac.MovieManiac$1.onClick(MovieManiac.java:41)
at android.view.View.performClick(View.java:4789)
at android.view.View$PerformClick.run(View.java:19881)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
嘗試做一個乾淨的構建 – Mo1989
我已經嘗試過,但這並沒有幫助。 :( – Archit