Abdelrahman Tamer
Abdelrahman Tamer

Reputation: 29

Gradle unable to rebuild in android studio

So i am still new to android studio and after finishing a test project,i kept getting errors about the gradle build and i dont understand what to do

startup failed:
build file 'C:\Users\*******\AndroidStudioProjects\Provac\build.gradle': 1: unexpected token: < @ line 1, column 1.
   <?xml version="1.0" encoding="utf-8"?>
   ^

1 error

The actual build.gradle file:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle"/>

Upvotes: 0

Views: 347

Answers (1)

Ryan M
Ryan M

Reputation: 20147

The problem is that your build.gradle file has been overwritten by an unrelated XML file, either due to human error or a bug in some piece of software.

If you have a backup or an earlier version of your code from version control, you should restore from it. Otherwise, you'll need to recreate your build.gradle file manually. The build.gradle file created by the Android Studio new project wizard is probably a good start, if you have to do that.

Upvotes: 1

Related Questions