我正在尝试从我正在创建的 Android 应用程序中连接到服务器上的网页,但由于某种原因,它似乎在一条线上失败了。
Java代码:
URL url = new URL("http://redsquirrelsoftware.co.uk/android/assignments/androidlogin.php");
HttpURLConnection hConnection = (HttpURLConnection)url.openConnection();
HttpURLConnection.setFollowRedirects(true);
hConnection.setDoOutput(true);
hConnection.setRequestMethod("POST");
// ERROR OCCURS ON NEXT LINE
PrintStream ps = new PrintStream(hConnection.getOutputStream());
ps.print("email=" + LoginActivity.email + "&" + "pword=" + LoginActivity.password);
ps.close();
hConnection.connect();
LogCat 响应给了我一个 IllegalStateException - 无法访问应用程序密钥,我以前从未见过,也不知道如何修复它。它还提到了我的任何代码中都没有的 TimerTask.run() - 猜测它是 Android 自己的一些代码?
01-08 21:28:55.300: E/MtpService(17770): TimerTask.run(): mReason =1
01-08 21:28:57.990: E/InputDispatcher(165): channel '41621cb0 uk.co.redsquirrelsoftware.assignmenttracker/uk.co.redsquirrelsoftware.assignmenttracker.LoginActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-08 21:29:01.870: E/GetJar SDK(17935): PackageMonitor: doOnReceive(): failed
01-08 21:29:01.870: E/GetJar SDK(17935): java.lang.IllegalStateException: Unable to access the application key
01-08 21:29:01.870: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor.doOnReceive(PackageMonitor.java:113)
01-08 21:29:01.870: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor.access$000(PackageMonitor.java:62)
01-08 21:29:01.870: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor$1.run(PackageMonitor.java:87)
01-08 21:29:01.870: E/GetJar SDK(17935): at java.lang.Thread.run(Thread.java:856)
01-08 21:29:02.230: E/GetJar SDK(17918): PackageMonitor: doOnReceive(): failed
01-08 21:29:02.230: E/GetJar SDK(17918): java.lang.IllegalStateException: Unable to access the application key
01-08 21:29:02.230: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor.doOnReceive(PackageMonitor.java:117)
01-08 21:29:02.230: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor.access$000(PackageMonitor.java:59)
01-08 21:29:02.230: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor$1.run(PackageMonitor.java:84)
01-08 21:29:02.230: E/GetJar SDK(17918): at java.lang.Thread.run(Thread.java:856)
01-08 21:29:02.470: E/GetJar SDK(17918): PackageMonitor: doOnReceive(): failed
01-08 21:29:02.470: E/GetJar SDK(17918): java.lang.IllegalStateException: Unable to access the application key
01-08 21:29:02.470: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor.doOnReceive(PackageMonitor.java:117)
01-08 21:29:02.470: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor.access$000(PackageMonitor.java:59)
01-08 21:29:02.470: E/GetJar SDK(17918): at com.getjar.sdk.data.metadata.PackageMonitor$1.run(PackageMonitor.java:84)
01-08 21:29:02.470: E/GetJar SDK(17918): at java.lang.Thread.run(Thread.java:856)
01-08 21:29:02.500: E/GetJar SDK(17935): PackageMonitor: doOnReceive(): failed
01-08 21:29:02.500: E/GetJar SDK(17935): java.lang.IllegalStateException: Unable to access the application key
01-08 21:29:02.500: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor.doOnReceive(PackageMonitor.java:113)
01-08 21:29:02.500: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor.access$000(PackageMonitor.java:62)
01-08 21:29:02.500: E/GetJar SDK(17935): at com.getjar.sdk.data.metadata.PackageMonitor$1.run(PackageMonitor.java:87)
01-08 21:29:02.500: E/GetJar SDK(17935): at java.lang.Thread.run(Thread.java:856)
01-08 21:29:17.530: E/dalvikvm(18081): Could not find class 'com.google.common.collect.HashMultiset', referenced from method com.fasterxml.jackson.datatype.guava.GuavaDeserializers.findCollectionDeserializer
01-08 21:29:17.540: E/dalvikvm(18081): Could not find class 'com.google.common.collect.EnumBiMap', referenced from method com.fasterxml.jackson.datatype.guava.GuavaDeserializers.findMapDeserializer
01-08 21:29:17.540: E/dalvikvm(18081): Could not find class 'com.google.common.collect.ImmutableSetMultimap', referenced from method com.fasterxml.jackson.datatype.guava.GuavaDeserializers.findMapLikeDeserializer
01-08 21:29:17.540: E/dalvikvm(18081): Could not find class 'com.google.common.collect.Table', referenced from method com.fasterxml.jackson.datatype.guava.GuavaDeserializers.findMapLikeDeserializer
关于如何修复它的任何建议?干杯