欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Android 日志错误收集

程序员文章站 2022-05-12 14:53:37
...

记录错误 避免长时间忘记

1. Fatal signal 11 (SIGSEGV), code 2, fault addr 0x7f674fb000 in tid -8665652 (

高并发下使用context 导致的 具体原因不明白
解决办法 使用context的方法 加 synchronized
```
  public synchronized static byte[] drawable2Byte(Context context, int tile_2) {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.tile_2);
    bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);

    byte data[] =baos.toByteArray();
    bitmap.recycle();
    try {
        if (baos != null)
            baos.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
    return data;
}

```

2. Android 错误无法debug 运行

Cannot debug application xx.xxx.xxx.app on device huawei-huawei_g7_tl00.

This application does not have the debuggable attribute enabled in its manifest.

If you have manually set it in the manifest, then remove it and let the IDE automatically assign it.

If you are using Gradle, make sure that your current variant is debuggable.
Android 日志错误收集

3. Instant Run requires ‘Tools | Android | Enable ADB integration’ to be enabled.

错误: Instant Run requires ‘Tools | Android | Enable ADB integration’ to be enabled.
Android 日志错误收集

4. Android studio 无法更新代码 AssertionError: null

android studio 在更新SVN 出现
AssertionError: null
在文件目录下 更新代码出现
Error: Please execute the ‘Cleanup’ command.
只要在 Cleanup 下 就可以更新了

5. Android 错误Error:Execution failed for task ‘:app:preDexDebug’.

Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 1

原因

sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }}
```  这个问题有很多问题导致的  有可能重启下studio 就好了





<div class="se-preview-section-delimiter"></div>

####6. Process 'command 'G:\android-sdk-windows\build-tools\20.0.0\aapt.exe'' finished with non-zero exit v
1. 暂时发现targetSdkVersion 要和supoport 相同   就是supoport  版本 不能高于 targetSdkVersion   
2. 查找是否有包冲突
3. 在build.gradle  中 android  字段里添加 




<div class="se-preview-section-delimiter"></div>

dexOptions {
javaMaxHeapSize “4g”
preDexLibraries = false
}
“`
- did you try to to “Build”-> “Clean Project” and then go to “Build” -> “Rebuild Project”

dexOptions {
    javaMaxHeapSize "4g"
    preDexLibraries = false
}
  • did you try to to “Build”-> “Clean Project” and then go to “Build” -> “Rebuild Project”

7.Android Studio升级3.1.2

org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not HEAD ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom‘. Received status code 405 from server: Method Not Allowed

删除.gradle 文件夹