Jimmy Bower
Jimmy Bower

Reputation: 311

Unable to open flutter project on android studio after upgrade

Yesterday I've upgraded my Windows 7 SP1 Powershell from 2 to 5.1, and upgraded flutter and dart to latest version using the flutter upgrade command, all worked fine, and I continued working as normal. Today after trying to access my project again I got a couple of errors, and all of my project structure gone. What can I do? and why that happened? Was that due to the upgrade? or something else?

Load Settings
Cannot load settings from file 'C:\Users\user\Documents\FlutterProjects\project\android\project_android.iml': ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
Please correct the file content

Load Settings
Cannot load settings from file 'C:\Users\user\Documents\FlutterProjects\project\project.iml': ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
Please correct the file content

Upvotes: 15

Views: 9161

Answers (5)

renatojoa
renatojoa

Reputation: 1

You can just go to your extensions tab on vscode search for dart and later for flutter and click on the Switch to Release Version Button.

reloading your version is required after this fix.

Image here

Upvotes: 0

Walied Abdulaziem
Walied Abdulaziem

Reputation: 399

Don't delete or rename any file in your project but when you update flutter, you must have compatible version from other plugins and dependencies with your new version, so do this steps and run again it will be ok:-

1- Close android studio and open it again

2- From terminal tab down in android studio run (flutter clean)

3- From terminal also run (flutter doctor)

4- Then run (flutter doctor -v)

5- After all at last run (pub outdated)

6- Close android studio and restart

7- Run your project and enjoy.

Upvotes: 0

Abdul hamid
Abdul hamid

Reputation: 11

simply cut the (PORJNAME).iml into the desktop and re-run the IDE or android studio. after re-running close the ide again and move back the (PORJNAME).iml to their own place, and open the ide

Upvotes: 0

Mohamad Eizeddin
Mohamad Eizeddin

Reputation: 896

Just delete .idea folder from project directory an re run android studio. it worked for me.

Upvotes: 27

akshay yadav
akshay yadav

Reputation: 484

The problem is caused by <projectname>.iml inside the root project folder.

  1. First cut the file from the folder and paste it somewhere else
  2. Restart Android Studio
  3. Close it again and put <projectname>.iml back into the root folder
  4. Restart Android Studio once again

Upvotes: 22

Related Questions