【Android错误(一)】
1、问题:This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Run (or updating either the IDE or the Gradle plugin to the latest version)
解决方案:
2、问题:遇到包冲突的问题的时候,可以使用如下的办法,查看具体是哪个包下面出现的问题。
解决方案:
在Setting中搜索Compiler,在Command-line Options选项中填入--stacktrace,然后编译。
3、问题:出现App打红叉但是项目不报错的的情况,或者是其他的一些报错但是又没有找到问题的情况下。
解决方案:
多数这种情况,可以尝试clean project或者rebuild project或者终极清缓存的方案
4、问题:Gradle running编译慢的问题
解决方案:
在设置(setting)中找到Gradle选项,然后给Offline work打上勾即可!如果还是不行就在:
在C:\User\<用户名>\.gradle 目录下新建一个gradle.properties文件,并在里面添加一行:org.gradle.daemon=true
5、问题:Error:Could not create service of type FileCollectionSnapshotterRegistry using TaskExecutionServices.createFileCollectionSnapshotterRegistry().
解决方案:
出现这个错误多半是Gradle编译的问题,只要关闭项目,去项目文件中删除.gradle文件夹。然后打开运行就可以了。
6、问题:app transformNative libsWithStripDebugSymbolForRelease
解决方案:
出现这个问题应该是so文件的引起的 gradle兼容性问题,将gradle的版本号降低就行了。如果是2.2.0的就降低到2.1.0就可以了
7、问题:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: Cannot merge new index 66857 into a non-jumbo instruction!
解决方案:
这个问题就代码函数过多的问题,直接在Build中加入multiDexEnabled true即可。