记录android过程中遇到的一些错误
Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
改正:
在app/build.gradle 理里将dependencies内容修改为:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestCompile 'com.android.support:support-annotations:26.1.0'
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:26.1.0'
}
}
Error:CreateProcess error=216, 该版本的 %1 与您运行的 Windows 版本不兼容。请查看计算机的系统信息,了解是否需要 x86 (32 位)或 x64 (64 位)版本的程序,然后联系软件发布者。
改正:
将SDK里的版本换成本地JDK
Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 1572864KB object heap
改正:
修改gradle.properties文件为然后(sync project)
java.lang.SecurityException: Requires VIBRATE permission
改正:
权限授予mainfest文件 缺少权限声明的语句
Eg:<uses-permission android:name="android.permission.VIBRATE"/>