尝试编译工作项目时 Android Studio 中的断言错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20063532/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Assertion Error in Android Studio when trying to compile the working project
提问by SH.
While I was trying to build my working project in the updated Android Studio (0.3.6), I got the below error message. It works fine when I build via CLI.
当我尝试在更新的 Android Studio (0.3.6) 中构建我的工作项目时,我收到以下错误消息。当我通过 CLI 构建时它工作正常。
java.lang.AssertionError
at com.android.tools.idea.gradle.compiler.AndroidGradleBuildProcessParametersProvider.getVMArguments(AndroidGradleBuildProcessParametersProvider.java:101)
at com.intellij.compiler.server.BuildManager.launchBuildProcess(BuildManager.java:921)
at com.intellij.compiler.server.BuildManager.access00(BuildManager.java:121)
at com.intellij.compiler.server.BuildManager.run(BuildManager.java:666)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at com.intellij.util.concurrency.BoundedTaskExecutor.run(BoundedTaskExecutor.java:37)
at com.intellij.openapi.application.impl.ApplicationImpl.run(ApplicationImpl.java:435)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
at com.intellij.openapi.application.impl.ApplicationImpl.run(ApplicationImpl.java:152)
I already opened the issue here.
我已经在这里打开了这个问题。
However, it only happens to the existing project. Android Studio can build newly created projects.
但是,它只发生在现有项目中。Android Studio 可以构建新创建的项目。
I am confuse whether this is a bug of Android Studio or is there any setting I need to change to my existing project?
我很困惑这是 Android Studio 的错误还是我需要更改现有项目的任何设置?
回答by anirus
Here is a better solution so you do not have to import the project again.
这是一个更好的解决方案,因此您不必再次导入项目。
Go to: File > Invalidate Caches/Restart
and select Invalidate and Restart
转到:File > Invalidate Caches/Restart
并选择Invalidate and Restart
回答by user2698468
Just remove .idea files from project. And import project again.
只需从项目中删除 .idea 文件。并再次导入项目。
回答by Micha? Tajchert
Or update The SDK Build Tools, in Android SDK.
或更新 Android SDK 中的 SDK 构建工具。
Worked for me.
为我工作。