Error while creating a new activity

I am trying to create a new activity but the following error appears (from the bottom of the image)

InvalidReferenceException: Error while executing FreeMarker template ...

If I manually create an Activity by creating a Java class that extends the Activity class then it works.

enter image description here

+3


source to share


1 answer


From the following link: Unable to create empty activity in Android Studio 2.2.3 , some people had the same problem:

ERROR - llij.ide.plugins.PluginManager - com.android.tools.idea.templates.FreemarkerUtils $ TemplateProcessingException: freemarker.core.InvalidReferenceException: The following evaluates to null or not: ==> manifestDir [in template "root: // activities / common / common_globals.xml.ftl "at line 26, column 39]

The problem is with the tmp folder created on drive C

When I first installed the Android SDK, I installed it on the C drive and did some exercises inside ud851-Exercises-student. Then, because I ended up with a space on drive C, I removed it from C and set it to D. Maybe I accidentally opened one of these projects and this makes Android Studio create a tmp folder in C.

Deleting the C: \ tmp folder solved the problem



I had the same problem ... Did deleting the tmp folder help.

Additional information on the root cause:

I figured out that this issue occurs because of the "buildDir" path in build.gradle in Udacity projects. See Screenshot.

enter image description here

+7


source







All Articles