我試圖運行GCM示例應用程序,但我在我的logcat中遇到致命異常(我的應用程序被強制關閉)它表明服務器URL鏈接是無效的URL。如果我運行我的URL鏈接,顯示「沒有註冊設備」。如果URL無效表示它顯示錯誤,但顯示「沒有設備註冊」。所以我很困惑。爲什麼我面臨這個問題。Android服務器註冊時的Google Cloud消息傳遞問題?
的logcat:
03-04 16:28:11.691: E/AndroidRuntime(770): FATAL EXCEPTION: AsyncTask #1
03-04 16:28:11.691: E/AndroidRuntime(770): java.lang.RuntimeException: An error occured while executing doInBackground()
03-04 16:28:11.691: E/AndroidRuntime(770): at android.os.AsyncTask$3.done(AsyncTask.java:299)
03-04 16:28:11.691: E/AndroidRuntime(770): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
03-04 16:28:11.691: E/AndroidRuntime(770): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
03-04 16:28:11.691: E/AndroidRuntime(770): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
03-04 16:28:11.691: E/AndroidRuntime(770): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
03-04 16:28:11.691: E/AndroidRuntime(770): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
03-04 16:28:11.691: E/AndroidRuntime(770): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
03-04 16:28:11.691: E/AndroidRuntime(770): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
03-04 16:28:11.691: E/AndroidRuntime(770): at java.lang.Thread.run(Thread.java:856)
03-04 16:28:11.691: E/AndroidRuntime(770): Caused by: java.lang.IllegalArgumentException: invalid url: 192.168.1.2:8080/home/register
03-04 16:28:11.691: E/AndroidRuntime(770): at com.google.android.gcm.demo.app.ServerUtilities.post(ServerUtilities.java:138)
03-04 16:28:11.691: E/AndroidRuntime(770): at com.google.android.gcm.demo.app.ServerUtilities.register(ServerUtilities.java:66)
03-04 16:28:11.691: E/AndroidRuntime(770): at com.google.android.gcm.demo.app.DemoActivity$2.doInBackground(DemoActivity.java:88)
03-04 16:28:11.691: E/AndroidRuntime(770): at com.google.android.gcm.demo.app.DemoActivity$2.doInBackground(DemoActivity.java:1)
03-04 16:28:11.691: E/AndroidRuntime(770): at android.os.AsyncTask$2.call(AsyncTask.java:287)
03-04 16:28:11.691: E/AndroidRuntime(770): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
03-04 16:28:11.691: E/AndroidRuntime(770): ... 5 more