Studio错误汇总
来源:互联网 发布:php的mvc模式 编辑:程序博客网 时间:2024/06/08 11:04
一:错误
当出现如下错误的时候,说明项目的minSdkVersion比测试机的SDK高,将minSdkVersion=16或者更小
错误二:
Error:(1, 0) Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to “a7fe329839d6518e9c116ccaa357e2c79c65192e”
Fix plugin version and sync project
Open File
解决办法:删除项目中原来的gradle文件,和build.gradle文件:
在把原来项目中能运行项目的build.gradle复制过来
**错误三:**Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
遇到这种错误那就是要在styles中设置窗口了:
<style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> <!--右滑返回--> <style name="AppTheme.NoActionBar.Translucent"> <item name="android:windowIsTranslucent">true</item> </style>
然后再清单文件(manifest)中找到对应的activity:设置theme
<activity android:name=".view.MainActivity" android:screenOrientation="portrait" android:theme="@style/AppTheme.NoActionBar.Translucent">
错误四:
解决办法:
错误5:
解决Execution failed for task ‘:app:clean’. > Unable to delete directory问题
在使用Android Studio编译工程的时候,出现了如下错误:
FAILURE: Build failed with an exception. 02. 03.* What went wrong: 04.Execution failed for task ':app:clean'. 05.> Unable to delete directory: F:\Android\AndroidStudioWorkSpace\AIDLDemo\app\build\outputs\apk 06. 07.* Try: 08.Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 09. 10.BUILD FAILED
终极解决办法:
删除F:\Android\AndroidStudioWorkSpace\AIDLDemo\app\ 目录下的build文件夹,然后重启Android Studio即可!
但是直接删除build文件夹删除不了,可以使用360文件粉碎机删除文件就可以了!
错误六
Studio编译的时候出现:
Error:org.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotter
Possible causes for this unexpected error include:
- Gradle’s dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network) - The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart) - Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
这个问题的时候
找到项目目录下的.gradle文件下的版本例如2.10,在版本文件内有taskArtifacts文件夹,把taskArtifacts这个文件夹删除后在此编译就可以了
错误七
当出现上述错误的时候解决方法如下,
错误八
在导入studio工程的时候,进行sync的时候,提示Error:Configuration with name ‘default’ not found.
解决办法:
1.打开settings.gradle发现里面有很多个include ‘:app’这样的include,然而发现在工程的目录下面根本没有include的项目,所以将需要include的项目添加进来,如果include的项目不需要,则将其include语句直接删掉,重新sync尝试。
2.按照上面的操作,要么添加了相应inlcude的工程进来,但是发现还是会提示这样的default not found语句,怎么回事呢,原来用gradle编译的工程,每个工程下面都必须要有build.gradle文件,才能够编译include的工程。整个大工程才能sync通过。把include工程中都添加上相应的gradle配置文件,再重新进行sync,整个工程都通过了。
错误九
UnsupportedMethodException
Unsupported method: AndroidProject.getPluginGeneration().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
解决方法:关掉instant run
错误十
Error:Execution failed for task ‘:pickerview:compileReleaseJava’. > Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
出现上面的错误解决办法:
错误11:
Error:Execution failed for task ':app:processDebugManifest'.> Manifest merger failed : Attribute application@icon value=(@drawable/icon_hbh) from AndroidManifest.xml:30:9-42 is also present at [xxx:wallet:unspecified] AndroidManifest.xml:16:9-43 value=(@mipmap/ic_launcher). Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:27:5-48:19 to override.
原因:
AS的Gradle插件默认会启用Manifest Merger Tool,若Library项目中也定义了与主项目相同的属性(例如默认生成的android:icon和android:theme),则此时会合并失败,并报上面的错误。
解决方案:
方法1:在在工程的Manifest.xml的application标签下添加tools:replace=”android:icon, android:theme”(多个属性用,隔开,并且记住在manifest根标签上加入xmlns:tools=”http://schemas.android.com/tools”,否则会找不到namespace哦,也可以按到Alt + Enter键快捷添加)
方法2:在build.gradle根标签上加上useOldManifestMerger true (懒人方法)
错误12:
当遇到一些莫名其妙的错误,如果有依赖的库的时候,需要和以来的库中保持SDK版本一致。
错误13:
Error:Dependency xxx:workorder:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: E:\xxx\workorder\build\outputs\apk\workorder-release-unsigned.apk
- Studio错误汇总
- Android Studio 错误汇总
- Android Studio 错误汇总
- Android Studio编译错误汇总
- Android Studio常见错误汇总
- Android Studio 工具错误汇总
- Android Studio Generate Signed APK 错误汇总
- android studio import project 错误汇总--基础篇
- Android Studio导入Eclipse项目工程错误汇总
- Android Studio导入Eclipse项目工程错误汇总
- Android开发错误——Android Studio中遇到过的错误问题与解决方案汇总
- 【Android Studio错误汇总】Error:(105, 20) 错误: 编码GBK的不可映射字符
- 错误汇总
- 错误汇总
- 错误汇总
- 错误汇总
- studio错误
- 【Android Studio错误汇总】Attribute "height" already defined with incompatible format.
- [Unity优化]UGUI图集的使用
- 【AndroidStudio_笔记】修改全局的包名
- MongoDB常用操作命令大全
- BestCoder Round #74 (div.2 c) hdu5637 Transform 【spfa】
- 2016寒假训练——栈模拟
- Studio错误汇总
- JavaScript学习笔记——基本类型和引用类型
- 语言篇-语言概览(C、C++、JAVA、Matlab、Python、R)
- 在cygwin上面安装gcc
- 冒泡排序
- hdu1509 Windows Message Queue(优先队列水)
- stm32 hal i2c 库读写sd3088时钟
- 泰勒python笔记一 :零碎知识
- Maven学习——修改Maven的本地仓库路径