创建新活动时出错 [英] Error while creating new Activity
问题描述
我正在尝试创建一个新的Activity,但出现以下错误(图像底部)
InvalidReferenceException:执行FreeMarker时出错模板...
如果我通过创建扩展活动类的Java类来手动创建活动,那么它可以工作。
从以下链接:在Android Studio 2.2.3中
I am trying to create a new Activity, but the following error comes up (bottom of image)
InvalidReferenceException: Error executing FreeMarker template...
If I manually create an Activity by creating a Java Class which extends the Activity Class, then it works.
From the following link : Cannot create empty activity, in Android Studio 2.2.3 , some people had the same kind of problem :
ERROR - llij.ide.plugins.PluginManager - com.android.tools.idea.templates.FreemarkerUtils$TemplateProcessingException: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> manifestDir [in template "root://activities/common/common_globals.xml.ftl" at line 26, column 39]
The problem was related to a tmp folder created on the C drive
When I first installed Android SDK, I installed it to the C drive and did some exercises inside ud851-Exercises-student there. Then, because I ran out of space on the C drive, I uninstalled it from C and installed it to D. Maybe I accidentally opened one of those projects and that cause the Android Studio to create the tmp folder in C.
Deleting the C:\tmp folder solved the problem
I was having the same issue...deleting tmp folder helped.
Some more information about the root cause :
I realized this issue is because of the "buildDir" path in build.gradle file in Udacity projects. See screen shot.
这篇关于创建新活动时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!