android 常见错误信息汇总

时间:2021-12-07 04:40:10
1,

03-02 16:12:50.456: E/SubmitMessage(3198): Submit string:

submit:trigger=0,bugtype=2,modulename=... ,level=1,testtype=NORMAL,path=/data/log/unzip/H60-

L01_V100R001CHNC00B307_022SSE146H004707_20150302161250_crash

 

方法1:可能是布局控件初始化的时候,初始化的控件类型有误。

方法2:可能是XML布局文件里调用的自定义空间的路径有问题。

 

2,

 W/dalvikvm(774): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/facebook/imagepipeline/memory/NativeMemoryChunk;
这个问题是本地os库文件造成的,可能是os库文件缺失。

PS:svn默认是不会copy os类型的文件,需要手动移动添加,这个问题被svn坑了两次,两次,次。。。。。。。


3,android studio 出现关于 jdk问题,java.exe  value 1 或者value 2 或者value 3 的问题。

方法:在build.gradle配置文件 

android{} 里增加  

dexOptions {
        javaMaxHeapSize "4g"
    }

或者在AndroidManifest 配置文件application
中添加:android:largeHeap="true"


4,Error:(1, 0) Plugin with id 'com.android.application' not found

方法:根部build.gradle   Just add build.gradle to top level

添加:// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.xx.y'
    }
}


allprojects {
    repositories {
        mavenCentral()
    }
}


5,ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_71\bin\java.exe'' finished with non-zero exit value 1

方法一:

That is because you enabled multiDex for release builds only, not for debug builds.
Try this:
defaultConfig {
    multiDexEnabled true
}


方法二:

dexOptions {
        javaMaxHeapSize "4g"  
    }

将4g改为2g或者1g即可


导致原因:项目中出现了重复的依赖。删除依赖项便可很容易地解决该问题。


6,

  1. E/AndroidRuntime(12747): Caused by: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState  
  2.     at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1314)  
  3.     at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1325


方案一: public abstract int commitAllowingStateLoss ()

Added in API level 11
Like commit() but allows the commit to be executed after an activity's state is saved. This is dangerous because the commit can be lost if the activity needs to later be restored from its state, so this should only be used for cases where it is okay for the UI state to change unexpectedly on the user.

大致意思是说我使用的 commit方法是在Activity的onSaveInstanceState()之后调用的,这样会出错,因为
onSaveInstanceState方法是在该Activity即将被销毁前调用,来保存Activity数据的,如果在保存玩状态后
再给它添加Fragment就会出错。解决办法就是把commit()方法替换成 commitAllowingStateLoss()就行了,其效果是一样的。

方案二: 注释掉super.onBackPressed(),加上finish()
@Override
    public void onBackPressed() {
//      super.onBackPressed();
        finish();
    }

方案三:
@Override
protected void onSaveInstanceState(Bundle outState) {
//No call for super(). Bug on API Level > 11.
}
@Override
protected void onSaveInstanceState(Bundle outState) {
outState
.putString("WORKAROUND_FOR_BUG_19917_KEY", "WORKAROUND_FOR_BUG_19917_VALUE");
super.onSaveInstanceState(outState);
}




问题:

Error:Could not find com.android.tools.build:gradle:2.1.0-alpha1/3.3

解决:项目嘴外目录 build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}


Error:Execution failed for task ':app:processDebugResources'.

> com.Android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/shaolin/Android/Sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1

1.资源文件名冲突
    可能是你之前加的图片文件命名一样,或则是替代上有问题.你可以先选择删除你导入的那张图片或则文件.

2.资源文件(图片)没有
    图片文件没有,未上传至svn
3.引用包重复
    Android studio 面有了v4包或者v7包,这个时候在libs下又添加了一次包,就会报这个错误,删掉Libs下重复的包就行了。
4.文件名显示的格式与文件本身的格式不对应
    这个比较难发现,重新换个正确的文件就可以了。
待测。

android studio2.3打包安装不了

1,instant run  关掉 
2, lintOptions {  abortOnErrorfalse  checkReleaseBuildsfalse  // 防止在发布的时候出现因MissingTranslation导致Build Failed!  disable'MissingTranslation' }
3,signingConfigs {  release {  storeFile file("myreleasekey.keystore")  storePassword"password"  keyAlias"MyReleaseKey"  keyPassword"password"  v2SigningEnabled false  }  }


问题:Error:Execution failed for task ':ctoiletglass:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list E:\Project_CGlass\ctoiletglass\build\intermediates\multi-dex\debug\maindexlist.txt --output E:\Project_CGlass\ctoiletglass\build\intermediates\transforms\dex\debug\folders\1000\1f\main E:\Project_CGlass\ctoiletglass\build\intermediates\transforms\jarMerging\debug\jars\1\1f\combined.jar}

解决:修改
compileSdkVersion 21
版本号,改为低版本。。
dexOptions {
javaMaxHeapSize "2g"
}
屏蔽掉