gpt4 book ai didi

java - W/System.err : com. parse.ParseRequest$ParseRequestException:i/o 失败

转载 作者:行者123 更新时间:2023-12-01 17:55:58 25 4
gpt4 key购买 nike

我正在尝试运行在 Parse 服务器中使用匿名登录的应用程序,但我在日志猫中收到以下内容。

该应用程序仅在我的一台装有 Android Oreo 8.1 的设备上运行,但当在另一台装有 Android Pie 的设备上尝试时,日志猫给出了。

这种情况仅发生在这个应用程序上,其他应用程序在我从用户那里获取用户名和密码时也会遇到同样的错误。

我已经尝试了 stackoverflow 上针对此问题给出的所有可能的解决方案,但错误没有消失。

有人知道 Parse 服务器只允许一台设备连接吗?

list 文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.parse.starter.uber">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:name=".StarterApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<activity
android:name=".DriverLocationActivity"
android:label="@string/title_activity_driver_location"></activity>
<activity android:name=".ViewRequestsActivity" />
<activity
android:name=".RiderActivity"
android:label="@string/title_activity_rider" />
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

连接到解析服务器的StarterApplication文件

package com.parse.starter.uber;

import android.app.Application;
import android.util.Log;

import com.parse.Parse;
import com.parse.ParseACL;
import com.parse.ParseException;
import com.parse.ParseObject;
import com.parse.ParseUser;
import com.parse.SaveCallback;


public class StarterApplication extends Application {

@Override
public void onCreate() {
super.onCreate();

Parse.enableLocalDatastore(this);

// Add your initialization code here
Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
.applicationId("MY_APP_ID")
.clientKey("MY_CLIENT_ID")
.server("http://13.126.179.137:80/parse/")
.build()
);

ParseACL defaultACL = new ParseACL();
defaultACL.setPublicReadAccess(true);
defaultACL.setPublicWriteAccess(true);
ParseACL.setDefaultACL(defaultACL, true);

}
}

项目分级

buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
}
}

allprojects {
repositories {
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

应用程序分级

apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "com.parse.starter.uber"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.parse.bolts:bolts-tasks:1.4.0'
implementation 'com.parse:parse-android:1.17.3'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
}


日志猫


2020-03-17 12:14:14.349 26020-26020/com.parse.starter.uber W/System.err: com.parse.ParseRequest$ParseRequestException: i/o failure
2020-03-17 12:14:14.353 26020-26020/com.parse.starter.uber W/System.err: at com.parse.ParseRequest.newTemporaryException(ParseRequest.java:292)
2020-03-17 12:14:14.353 26020-26020/com.parse.starter.uber W/System.err: at com.parse.ParseRequest$2.then(ParseRequest.java:146)
2020-03-17 12:14:14.353 26020-26020/com.parse.starter.uber W/System.err: at com.parse.ParseRequest$2.then(ParseRequest.java:140)
2020-03-17 12:14:14.354 26020-26020/com.parse.starter.uber W/System.err: at bolts.Task$15.run(Task.java:917)
2020-03-17 12:14:14.354 26020-26020/com.parse.starter.uber W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
2020-03-17 12:14:14.354 26020-26020/com.parse.starter.uber W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2020-03-17 12:14:14.354 26020-26020/com.parse.starter.uber W/System.err: at java.lang.Thread.run(Thread.java:764)
2020-03-17 12:14:14.355 26020-26020/com.parse.starter.uber W/System.err: Caused by: java.net.UnknownServiceException: CLEARTEXT communication to 13.126.179.137 not permitted by network security policy
.
.
.
.
.
2020-03-17 12:14:14.363 26020-26020/com.parse.starter.uber I/Info: Anonymous Login Failed

最佳答案

标题

Manifest merger failed : Attribute application@appComponentFactory - Androidx

选项 1 -创建文件 res/xml/network_security_config.xml -

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">Your URL(ex: 127.0.0.1)</domain>
</domain-config>
</network-security-config>

AndroidManifest.xml -

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:networkSecurityConfig="@xml/network_security_config"
...>
...
</application>
</manifest>

选项 2 -AndroidManifest.xml -

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
</manifest>

关于java - W/System.err : com. parse.ParseRequest$ParseRequestException:i/o 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60717631/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com