android开发中遇到的问题汇总【六】

190. Genymotion Crash after a few minutes

E/eglCodecCommon(2163): writeFully: failed: Broken pipe

http://stackoverflow.com/questions/23855115/genymotion-crash-after-a-few-minutes

It's not really caused by your application, so don't worry.

It often happens when you computer goes in sleep mode and when you come back Genymotion will throw this exception (it happens to me very often).

In your specific case sounds like the device goes in sleep mode so a way to fix it is simply to enable "Always stay awake" in developers options.

192. A WebView method was called on thread ‘Timer-1’. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.

java.lang.IllegalStateException: Timer was canceled
at java.util.Timer.scheduleImpl(Timer.java:561)
at java.util.Timer.schedule(Timer.java:481)
at com.jetsun.hbfc.activity.base.CommonWebViewActivity$3.onPageStarted(CommonWebViewActivity.java:178)

Webview reload page get force close

Change your TimerTask to the following:

new TimerTask() {
@Override
public void run() {
runOnUiThread(new Runnable() {
public void run() {
wvNovaMenzaCammera.reload();
}
});
}
}

193.http://blog.csdn.net/xieyuooo/article/details/8607220

Timer与TimerTask的真正原理&使用介绍

194.http://233.io/article/1057296.html Fragment的通信有关问题, 新建Fragment为何不要在构造方法中传递参数

195.Add a new file in Intellij doesn’t add to subversion

http://stackoverflow.com/questions/2817452/add-a-new-file-in-intellij-doesnt-add-to-subversion
    Go to File -> Settings -> Version control -> Confirmation -> When files are created You're probably looking for "Add silently".

196.使用Android Studio的lint清除无用的资源文件 http://waychel.com/shi-yong-android-studiode-lintqing-chu-wu-yong-de-zi-yuan-wen-jian/

197. Android应用程序release打签名包时,出现错误:”XXX” is not translated in “af” (Afrikaans), “am” (Amharic), “ar” (Arabic)…..

eclipse
http://blog.csdn.net/u012264122/article/details/39371343

androidstudio http://stackoverflow.com/questions/20699147/gradle-build-fails-on-lint-task

// This is important, it will run lint checks but won't abort build
  lintOptions {
      abortOnError false
  }


if abortOnError false will not resolve your problem, you can try this.

lintOptions {
    checkReleaseBuilds false
}

198.

全面提高Ubuntu Linux操作系统运行速度

1.六招让你的Ubuntu马上提速  http://article.yeeyan.org/view/205625/294577


       Where did the startup-applications-preferences program go?  ubuntu satartup applications preference
     http://askubuntu.com/questions/159887/where-did-the-startup-applications-preferences-program-go
    The if you can't find the program anywhere, try running gnome-session-properties from the command line (or alt+f2).

    If it's not installed, I'm sure you can install the package gnome-session-properties.

2. 将localhost化名为主机名

    据说这个方法可以改善使用Ubuntu一段后,在GNOME中启动应用程序变慢的问题

    # vi /etc/hosts

    127.0.0.1 localhost

    127.0.1.1 Ubuntu

    ===>

    127.0.0.1 localhost Ubuntu

    127.0.1.1 Ubuntu

    注:在第一行末尾加上主机名,也就是第二行的那个名字。

3.安装preload

    可以把一些常用到的lib库和应用程序预加载到内存,以提高程序的启动速度

    # apt-get install preload

199.volley由于网络访问比较慢,导致访问两次的现象 http://stackoverflow.com/questions/22428343/android-volley-double-post-when-have-slow-request?

    http://stackoverflow.com/questions/3352424/httpurlconnection-openconnection-fails-second-time

200.当你想让一个高度值不足scrollview的子控件fillparent的时候,单独的定义 android:layout_height=”fill_parent”是不起作用的,必须加上fillviewport属性,当子控件的高度值大于 scrollview的高度时,这个标签就没有任何意义了。

201.activity FLAG_ACTIVITY_REORDER_TO_FRONT 无法startActivity http://blog.csdn.net/mingli198611/article/details/8678513

202. Genymotion模拟器运行项目 jPush报错jpush Couldn’t load jpush: findLibrary returned null

at cn.jpush.android.api.JPushInterface.init(Unknown Source)

203.androidstudio检查更新。Android Studio支持自动检查更新。之前尚未发布正式版时,一周有时会有几次更新。你可以设置检查的类型,用以控制更新类型。

Settings --> Updates 。勾选 Check for updates in channel ,即开通了自动检查更新。你可以禁用自动检查更新。右侧的列表,是更新通道。
Stable Channel : 正式版本通道,只会获取最新的正式版本。
Beta Channel : 测试版本通道,只会获取最新的测试版本。
Dev Channel : 开发发布通道,只会获取最新的开发版本。
Canary Channel : 预览发布通道,只会获取最新的预览版本。rc  release candidates

以上4个通道中, Stable Channel 最稳定,问题相对较少, Canary Channel 能获得最新版本,问题相对较多。

204.AndroidのActivity之Listview组件快速拖动 android:fastScrollEnabled=”true” android:focusable=”true”

205. Lint: How to ignore “ is not translated in ” errors?

http://stackoverflow.com/questions/11443996/lint-how-to-ignore-key-is-not-translated-in-language-errors
To ignore this in a gradle build add this to the android section of your build file:

lintOptions {
disable ‘MissingTranslation’
}

Authentication Error errorcode: 201 uid: -1 appid -1 msg: APP被用户自己禁用

ubuntu apktool 2.0 Exception in thread “main” brut.androlib.err.UndefinedResObject

keytool -list -keystore SportsApp.keystore

206.Exception in thread “main” brut.androlib.AndrolibException: Could not decode arsc file

at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:491)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
at brut.androlib.Androlib.getResTable(Androlib.java:50)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)

Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:44)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:102)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
… 8 more

It seems there’s some problem in building the resources while recompiling the apk. what you can do is, when you decompile your apk use this command

apktool d -f -r apkfilename.apk
here -f is to replace previous decompiled apk’s code and -r is to ignore the decompiling of resources.

this would prevent the resources from being decompiled and will simply copy the same resources when you recompile the apk.

208 android sharesdk微信分享 创建应用时所需的应用签名怎么得到

根据这个页面提供的一个工具 签名生成工具
https://open.weixin.qq.com/cgi-bin/readtemplate?t=resource/app_download_android_tmpl&lang=zh_CN
Android资源下载
开发工具包
开发第三方应用所需要的库以及文件。点击下载
范例代码
包含了一个完整的范例工程。该范例的使用可以参阅Android平台上手指南:HelloWeixin@Android。点击下载
签名生成工具用于获取安装到手机的第三方应用签名的apk包。点击下载

可以一个字符串,类似于:
应用签名:049a9fde46bfc5087f3825582208b248
安装这个应用可以获取本手机已经安装的某个android软件,根据软件的包名,类似于: com.demo.AppX 来查找这个软件,以及获取这个软件的 应用签名。
还有一个工具是在
http://wiki.open.qq.com/wiki/mobile/SDK下载
Android_SDK_V2.3.1 的tools目录下有一个 获取签名.apk ,这个也可以获取,但是我测试发现,只能显示一部分的本机应用,有些应用查不到,就麻烦了..

209.:app:lintVitalRelease

Failed converting ECJ parse tree to Lombok for file /home/yyb/work/BoShiTong/trunk/HBFC/Android/Comment/HBFC-AS2/app/src/main/java/com/jetsun/hbfc/widget/ioc/AbIocView.java
java.lang.ClassCastException: lombok.ast.Annotation cannot be cast to lombok.ast.Expression

210. Ignoring InnerClasses attribute for an anonymous inner class

211.WebView 在Android4.4的手机上onPageFinished()回调会多调用一次(具体原因待追查)

需要尽量避免在onPageFinished()中做业务操作,否则会导致重复调用,还有可能会引起逻辑上的错误.
onPageStarted和onPageFinished 会加载两次

更多问题请关注 android开发遇到问题点滴

猜你喜欢

转载自blog.csdn.net/u011570979/article/details/45843317