Coder Social home page Coder Social logo

xutils3's Issues

每次请求网络结束后,UI都会卡顿

I/Choreographer: Skipped 42 frames! The application may be doing too much work on its main thread.

列表中上拉加载更多时,更是卡得不行,这次使用的机器是nexus4,5.1.1的系统,3.1.8版本

快速加载本地缓存文件会出现问题

http://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0B6Okdz75tqQsQ0l4MWpTMmJCTm8/style_imagery_integration_hero1.png
org.xutils.ex.FileLockedException: /storage/emulated/0/Android/data/com.xhl.windowofword/cache/xUtils_img/7590aef6920e0732bf7526b5afc18c15
at org.xutils.cache.LruDiskCache.createDiskCacheFile(LruDiskCache.java:164)
at org.xutils.http.loader.FileLoader.initDiskCacheFile(FileLoader.java:263)
at org.xutils.http.loader.FileLoader.load(FileLoader.java:176)
at org.xutils.http.loader.FileLoader.load(FileLoader.java:41)
at org.xutils.http.request.UriRequest.loadResult(UriRequest.java:81)
at org.xutils.http.request.HttpRequest.loadResult(HttpRequest.java:222)
at org.xutils.http.HttpTask$RequestWorker.run(HttpTask.java:506)

同步请求会失败

示例代码

 RequestParams params=new RequestParams("http://www.baidu.com");

        try {
           String response= x.http().getSync(params,String.class);
            System.out.println(response);
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }

异步就不会!

 java.lang.NullPointerException
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err:     at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:632)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:347)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err:     at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err:     at org.xutils.http.request.HttpRequest.getResponseCode(HttpRequest.java:307)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err:     at org.xutils.http.HttpTask.doBackground(HttpTask.java:271)
11-28 22:17:22.738 22125-22125/org.xutils.sample W/System.err:     at org.xutils.common.task.TaskControllerImpl.startSync(TaskControllerImpl.java:63)
11-28 22:17:22.742 22125-22125/org.xutils.sample W/System.err:     at org.xutils.http.HttpManagerImpl.requestSync(HttpManagerImpl.java:109)
11-28 22:17:22.742 22125-22125/org.xutils.sample W/System.err:     at org.xutils.http.HttpManagerImpl.getSync(HttpManagerImpl.java:96)

x.Ext.init

建议参数类型改为context,现在是application,感觉不方便

org.xutils.ex.FileLockedException 异常信息

11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): org.xutils.ex.FileLockedException: /storage/emulated/0/Android/data/com.tigeroid/cache/xUtils_img/8ce22f4362f505df8535f7e3110519f9
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.cache.LruDiskCache.createDiskCacheFile(LruDiskCache.java:164)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.loader.FileLoader.initDiskCacheFile(FileLoader.java:263)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.loader.FileLoader.load(FileLoader.java:176)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.loader.FileLoader.load(FileLoader.java:41)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.request.UriRequest.loadResult(UriRequest.java:81)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.request.HttpRequest.loadResult(HttpRequest.java:222)
11-29 15:33:43.449 7130-7130/com.tigeroid E/x_log:ImageLoader.onError(L:409): at org.xutils.http.HttpTask$RequestWorker.run(HttpTask.java:506)

java.lang.NoClassDefFoundError:

x.http().get(requestParams, new Callback.CommonCallback() ,使用这个方法时会报错:
java.lang.NoClassDefFoundError: org/xutils/http/request/HttpRequest

加载图片报错

11-25 03:49:30.706 6798-6798/org.xutils.sample E/x_log:ImageLoader.onError(L:409): http://wap.baidu.com/static/img/r/image/2014-04-18/a250be0f0af4d9dd116b4bf1f37dc5c6.jpg
java.io.EOFException
at libcore.io.Streams.readAsciiLine(Streams.java:203)
at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:573)
at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821)
at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:495)
at org.xutils.http.request.HttpRequest.sendRequest(HttpRequest.java:187)
at org.xutils.http.loader.FileLoader.load(FileLoader.java:212)
at org.xutils.http.loader.FileLoader.load(FileLoader.java:40)
at org.xutils.http.request.UriRequest.loadResult(UriRequest.java:81)
at org.xutils.http.request.HttpRequest.loadResult(HttpRequest.java:222)
at org.xutils.http.HttpTask$RequestWorker.run(HttpTask.java:503)

上传文件顺序

fileParams现在是hashmap,会导致顺序错乱,和上传顺序不一致,建议改为LinkedHashMap

怎么用保存cookie呢?

记得2.6版本中是通过configCookieStore来处理cookie的,新版中的cookie持久化是需要自己做吗?谢谢!

使用xUtils3 get数据的问题

11-24 19:43:28.230 24229-24446/? W/dalvikvm: Exception Ljava/lang/RuntimeException; thrown while initializing Lorg/xutils/http/cookie/DbCookieStore;
11-24 19:43:28.230 24229-24446/? W/dalvikvm: Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lorg/xutils/http/request/HttpRequest;
11-24 19:43:28.255 24229-24229/? I/hehe: onErrornull
11-24 19:43:28.255 24229-24229/? I/hehe: onFinished

点击事件问题

例如有个button,我要在代码里动态的设置OnClickListener,但是现在点击事件的方法必须是private的,和View.OnClickListener public不一致,必须要搞两套。有什么办法能解决这个问题么?最好是能像xutils之前版本一样,能公用一个点击方法

能不能根据作用把工具分开呢

能不能根据作用把工具分开呢
例如我已经使用了一个图片框架
不需要里面的图片框架了
但是你这里面还引入了一些so文件,并且文件还蛮大的

Http问题

Http请求怎样设置超时?读超时这类的?还是默认已经设置好了? catch (Throwable throwable)我要怎么来严格区分哪些错误是服务器错误,哪些错误是网络错误?

加载图片 异常信息

11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): Unsupported Bitmap configuration. Currently only RGBA_8888 and RGB_565 are supported
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): java.lang.RuntimeException: Unsupported Bitmap configuration. Currently only RGBA_8888 and RGB_565 are supported
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at android.backport.webp.WebPFactory.nativeEncodeBitmap(Native Method)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder.saveThumbCache(ImageDecoder.java:501)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder.access$0(ImageDecoder.java:491)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder$1.run(ImageDecoder.java:131)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
11-26 09:57:12.436: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.lang.Thread.run(Thread.java:818)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): Unsupported Bitmap configuration. Currently only RGBA_8888 and RGB_565 are supported
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): java.lang.RuntimeException: Unsupported Bitmap configuration. Currently only RGBA_8888 and RGB_565 are supported
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at android.backport.webp.WebPFactory.nativeEncodeBitmap(Native Method)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder.saveThumbCache(ImageDecoder.java:501)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder.access$0(ImageDecoder.java:491)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at org.xutils.image.ImageDecoder$1.run(ImageDecoder.java:131)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
11-26 09:57:12.501: W/x_log:ImageDecoder.saveThumbCache(L:508)(7486): at java.lang.Thread.run(Thread.java:818)

当加载图片过多时,存在图片无法加载的情况

1)如加载一个有分页的列表,每个item最多有5张或者6张图片
2)当加载20页或者30页后发现图片不能加载,重启应用也不能加载图片,只有清楚数据或者重新安装应用才能正常恢复。图片加载这个模块感觉就失去功能了,难道有设置了限制导致的?

百度地图不能用

为什么用了xutil3之后,百度地图在有的机子上运行不了啊,百度地图初始化就报错,我的机子是5.0系统的,在4.X系统的机子没有问题。

按README的提示无法初始化

Hello,
我在gradle中添加依赖后,按照README的提示进行初始化,找不到x所在的包,是人品问题么。。。

在Library项目中使用的问题

在Library项目中,R.id.XXX已经不是final修饰,所以在Library项目中似乎使用不了这个工具。这个问题有解吗?

还是cancel问题

请问:
1.setCancelFast的作用是什么?
2.setCancelFast设为true,设置线程池的max size为1,当A下载任务在执行中,B下载任务等待中,cancel B任务时,并不会立即执行B任务回调,等到A任务执行完后或cancel A任务后才回调,如何优化?
补充:
取消下载时,cancel会调用两次
E/x_log:DownloadManager.stopDownload(L:156): stopDownload
E/x_log:DownloadCallback.cancel(L:106): cancel
E/x_log:DownloadCallback.cancel(L:106): cancel

maven

能否添加到maven仓库。

http请求cancel问题

调用Cancelable的cancel后,CommonCallback.onCancelled没有调用,走到onError了

downloadcallback 弱引用带来的问题

我看源码里面,将回调设置成了弱引用,而弱引用随时可能被gc回收,所以可能导致接收不到回调信息?在下载大文件时,下载一段时间前台就接受不到回调信息了。小文件还好,我改成强引用就行了,请问为啥设计成弱引用呢?新人求教
private WeakReference viewHolderRef;

建议修改一下ViewUtils的注入异常检测

因为用ViewUtils注入的时候,加入注入内容有误,或者找不到。他的提示很不友好,很不容易定位到有问题的某个属性。
下面是我自己修改的代码,望有帮助。
View findView = finder.findViewById(viewInject.value());
if (findView != null) {
field.setAccessible(true);
try {
field.set(object, findView);
} catch (Throwable e) {
String modifier = Modifier.toString(field.getModifiers());
String genericString[] = field.toGenericString().split(" ");
String type = genericString[1];
String name = field.getName();
String injectViewName = findView.getClass().toString().replaceFirst("class", "");
LogUtils.e(modifier + " " + type + " " + name + " 将要注入" + injectViewName);
}
} else {
String modifier = Modifier.toString(field.getModifiers());
String genericString[] = field.toGenericString().split(" ");
String type = genericString[1];
String name = field.getName();
LogUtils.e(modifier + " " + type + " " + name + " 注入id无效");
}

DbUtil

dbutils是否支持类嵌套?

class A{
  int a1
 String stra
}

class B{
A a
int b
String strb
}

这样直接保存B的对象可以吗?

数据库加密

希望数据库能进行加密处理,保证数据安全

下载时有几率出现HTTP 400

同一个下载任务 点了开始下载 等一下再点停止下载 然后再点开始 有几率出来 HTTP 400
Bad request
code: 400, msg: Bad request, result: null

断点续传策略

断点续传策略需要服务器配合吗?比如上传一半失败了,下次可以继续上传?

性能问题

这个和OKHttp相比,应该没有优势吧!

4.0.3的机器请求网络时报错

Could not find method java.net.HttpURLConnection.setFixedLengthStreamingMode, referenced from method org.xutils.http.request.HttpRequest.sendRequest

VFY: unable to resolve virtual method 35050: Ljava/net/HttpURLConnection;.setFixedLengthStreamingMode (J)V

VFY: replacing opcode 0x6e at 0x0219

Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)

然后app就挂掉了,但是却没有任何其他的错误输出,app闪退时也不弹窗提示“很抱歉,xx已停止运行”,反正app界面就突然消失了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.