Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Androidstudio java class file showing as a text file in IDE

I have ported my project from Eclipse to Android Studio.But my Application class "AppController.java" alone showing as a text file.I deleted the file and created again but getting following error message.

Unable to parse template "class" Error message: Selected class file name mapped 'AppController.java' to not java file type 'Textfiles'

Note: I have double checked the file types but no luck. File->Settings->File Types the file type for Java source files, Java class files and Text files

like image 337
Rajiv Manivannan Avatar asked Jan 28 '15 06:01

Rajiv Manivannan


People also ask

How do I view .class files in Android Studio?

You can find them in the build/intermediates/classes/debug/* directory. Save this answer. Show activity on this post. Rename the following .

How do I file a Java class file?

In Java application, the entry point is the main() method. The javac command is used to convert the Java source file into the class file. The java command is used to run a Java program stored in a . class file.

Which Java class is the preferred class for writing to a text file?

Java FileWriter class in java is used to write character-oriented data to a file as this class is character-oriented class because of what it is used in file handling in java.

Is a Java source file a text file?

Java source files are American Standard Code for Information Interchange (ASCII) text files in the integrated file system. You can create and edit a Java source file with IBM i Access for Windows and a workstation-based editor.


2 Answers

I have also encountered the same issue and from your suggestion went to File->Settings->File Types and saw the file name I am trying to create say xyz.java is registered in the "recognized file types" list. As soon as I deleted the entry from that list xyz.java is recognized properly.

like image 169
Rajaraman Subramanian Avatar answered Oct 21 '22 20:10

Rajaraman Subramanian


Deleted the Android studio's ".AndroidStudio" In the following path from my system C:\Users\user.

Started the Android Studio and configured freshly. That worked for me!

like image 33
Rajiv Manivannan Avatar answered Oct 21 '22 20:10

Rajiv Manivannan