Comments (11)
我前面看错分钟成秒了,你的超时时间并不短。
看你使用的OkHttp作为底层,我搜了一下,这个有可能是OkHttp的问题:
square/okhttp#3974
你把底层切换为URLConnection试试看这个问题还出现吗,另外URLConnection作为底层时,在Android4.4以下的系统中,DELETE请求不支持上行body。
from kalle.
宽带WIFI不会有问题
from kalle.
具体异常信息是什么?
from kalle.
from kalle.
超时了呀,不是文件被占用就是网络不好,链接服务器不稳定。大多数是后者。
from kalle.
图片选择用的您的Album库,应该不存在文件被占用吧?网络应该不会有问题吧,4G网也不慢,外网WI-FI都能成功上传。刚刚试了下本地局域网也有这个问题。好蛋疼,甲方要演示。
from kalle.
这是我的图片选择封装方法
这是我调用的地方
这是我的上传业务部分
请教下我这样的使用是否存在问题而导致报错呢?
from kalle.
应该是网络超时,你把超时时间设置长一点。
from kalle.
你好,在kalle在Application初始化时设置了超时为3分钟,如图,这样是有效的吗,但是好像对问题提到的报错没有什么影响,大概三十秒不到就报错了。
from kalle.
果然是OkHttp的坑,换成
AppConfig.get().initFileDir();
Kalle.setConfig(KalleConfig.newBuilder()
.connectFactory(URLConnectionFactory.newBuilder().build())
.cookieStore(DBCookieStore.newBuilder(this).build())
.cacheStore(DiskCacheStore.newBuilder(AppConfig.get().PATH_APP_CACHE).build())
.network(new BroadcastNetwork(this))
//.addInterceptor(new LoginInterceptor())//自动重新登录拦截器
// 可以添加 请求失败自动重试拦截器
.addInterceptor(new LoggerInterceptor("EB-HTTP", BuildConfig.DEBUG))
.addInterceptor(new RetryInterceptor(3))
.converter(new JsonConverter(this))
.connectionTimeout(3, TimeUnit.MINUTES)
.readTimeout(3, TimeUnit.MINUTES)
.build());
from kalle.
就可以了,十分感谢您
from kalle.
Related Issues (20)
- 只有onStart被调用是什么情况
- java.io.IOException: unexpected end of stream on Connection
- 我下载了示例代码,改了HttpEntity和JsonConverter,在JsonConverter中获取到结果的地方打了断点,发现请求成功,但是HttpEntity中的code字段没有成功解析到值 HOT 1
- BroadcastNetwork.NetworkReceiver ANR
- 请求https报错
- Https 请求报错 HOT 1
- An unkown exception: 这个可能是什么错误导致
- 网络请求出错 NetWorkError HOT 3
- 单个接口传参与公共参数key相同时,为什么没有覆盖而是重复传值? HOT 1
- 网络请求大概率出现NetworkError,有没有什么解决方案 HOT 1
- 请问如何修改和添加User-Agent
- 是否可以动态添加拦截器 HOT 6
- 拦截器打印response.body().string()之后就拿不到响应内容 HOT 1
- anr for MainExecutor
- Android 10 ,使用 ssl 无法正常运行
- 上传文件Bug HOT 1
- ResponseBody没有source()方法导致没办法在拦截器里面copy响应体 HOT 2
- 病毒提示:Android/Agent.CSV HOT 1
- 拦截器无法调用request body 和 response body
- 无法修改默认的Content-Type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kalle.