本文主要是介绍8.12笔记 retrofit超时设置,studio 修改 Lint Error Checking,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
8.12笔记 retrofit超时设置,studio 修改 Lint Error Checking
retrofit请求库设置超时
http://stackoverflow.com/questions/29380844/how-to-set-a-timeout-in-retrofit-library
public RestAdapter providesRestAdapter(Gson gson) {final OkHttpClient okHttpClient = new OkHttpClient();okHttpClient.setReadTimeout(60, TimeUnit.SECONDS);okHttpClient.setConnectTimeout(60, TimeUnit.SECONDS);return new RestAdapter.Builder().setServer(BuildConfig.BASE_URL).setConverter(new GsonConverter(gson)).setClient(new OkClient(okHttpClient)).build();
}
http://stackoverflow.com/questions/7071271/activity-class-does-not-exist
Launching application: com.foo.app/com.foo.app.main.
DEVICE SHELL COMMAND: am start -n “com.foo.app/com.foo.app.main”
Starting: Intent { cmp=com.foo.app/.main}
Error type 3
Error: Activity class {com.foo.app/com.foo.app.main} does not exist.
Activity class does not exist
如果以上方法修复不了,而且你的手机是nexus5(其他手机可以运行),那就是nexus系统的bug,修改包名后造成,原因未知。
如果studio开启了lint error checking(默认开启),国际化string文件不齐全,build-apk就会失败,需要关闭
http://stackoverflow.com/questions/25870932/how-to-remove-lint-errors-in-android-studio
studio
Lint Error Checking
需要加这样一句话
android {lintOptions {abortOnError false}
}
[2012-05-07 09:32:02 - SQLiteTest] Installation error: INSTALL_FAILED_CONFLICTING_PROVIDER
[2012-05-07 09:32:02 - SQLiteTest] Please check logcat output for more details.
[2012-05-07 09:32:02 - SQLiteTest] Launch canceled!
结果百度才知道原来是因为相同的Provider,所以得改一下AndroidManifest.xml的
这篇关于8.12笔记 retrofit超时设置,studio 修改 Lint Error Checking的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!