Why the following error is showing while importing an project? - android

Why the following error is showing in android studio while importing a external project (https://github.com/udacity/ud839_Miwok/tree/Starter-code)?
Error: Gradle 'ud839_Miwok-Starter-code' project refresh failed
Error:Content is not allowed in prolog.

Try to clean and to rebuild your project. This is located at the Build Menu.
If this does not help, please show more details like your project tree, especially your resource diretory. It may also be that you created something at a place where it is not allowed to be.

Related

update failed java.io.FileNotFoundException

i updated my ide to letest version after update i opend project on which i was working before update but it gave error but when i opend other projects there had no error
please help Thank you
update failed for AnAction(com.intellij.execution.ExecutorRegistryImpl$ExecutorAction) with ID=Run
java.io.FileNotFoundException: E:\Android\WhatsApp\app\build\intermediates\apk_ide_redirect_file\debug\..\..\apk\debug\output-metadata.json (The system cannot find the file specified)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileReader.<init>(FileReader.java:75)
just clean project and make a build
It is solved by just rebuild project
Build → Rebuild project
Workaround: if you encounter this error generating an APK, first clean the project (Build -> Clean project)
Open your project.
If your project files are not loaded and instead you see: 'Loading...' cancel Sync Gradle by clicking on X at the bottom, this should show your files back.
Clean Project: Build -> Clean Project
Rebuild Project: Build -> Rebuild Project
In my case, I was unable to Clean Project as well as Sync Gradle Files, So
Eventually I was about to give up, but then I went to
AndroidStudioProjects/project_name/app/build/intermediates/apk_ide_redirect_file/debug in the file explorer and found a file named redirect
That file contained the following information
#- File Locator -
listingFile=../../apk/debug/output-metadata.json
From here, I tried to locate the path mentioned in this file and I was unable to find itSo I searched output-metadata in the file explorer from AndroidStudioProjects/project_name and I found a bunch of output-metadata files, I copied the first one and pasted it in the mentioned location, and then everything worked perfectly
Now I don't know wether this is the right way to solve this or not, but it worked...
Hope it helps you...

"No resource found" errors Android gradle build for files in .gradle/caches

My Gradle build on Android Studio fails with multiple errors such as.
C:\Users\%USER_HOME%\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.0.2.aar\67e074a850e794c5187b156467264a93\res\layout\abc_alert_dialog_material.xml
Error:(26, 22) No resource found that matches the given name (at 'layout' with value '#layout/abc_alert_dialog_title_material').
The project is an exercise code of Udacity Android course. I have no changes of my own. It compiles fine when others try.
Anyone seen the same?
Delete your build cache and then rebuild your project i.e,
Delete the build folder inside your app directory
Rebuild your project and then try again
I was getting these errors because the project name was very long, and the location I was saving the project in, added to it. That apparently caused some files to be missing. Moving the project to another location so that the file names are not crossing the system limit resolved the errors for me.
Thank you all for your help!

Android Studio loading issue

How to solve this issue .
Load setting Cannot load settings from file
'C:\Users\sujeet14108\AndroidStudioProjects\Rough.idea\gradle.xml':
Error on line 1: Content is not allowed in prolog.
Please correct the file content
The problem is occurring because of gradle.xml inside App/build directory of your project.
Try this way
Clean your project using Build > Clean Project
Close your Android Studio now
Go to the project directory and delete the gradle.xml file
Open Android Studio again and let it sync the project with gradle .
Android studio compile error "Content is not allowed in prolog"

Android Studio renaming

I recently renamed my Android app project in Android Studio (1.1b4) project, but am now unable to rebuild. I get this error:
Error:Execution failed for task ':app:clean'.
> Unable to delete directory: D:\AndroidstudioProjects\PcUpload\app\build\intermediates\res\release\values-sw600dp-v13
I renamed by right-clicking the top-level in the Project hierarchy, then selecting "Refactor...Rename".
Can anyone advise how I can remedy this?
Please make sure to rename project using refactor. You are getting that error because that project technically doesnt exsist under that directory, due to rename.
Another solution would be
Close android studio
Change project root directory name
Open android studio
Open the project(not from local history but by browsing to it)
Or follow This youtube video!
Or this!

Facebook SDK/Android, Eclipse cannot find resource files

When trying to build project HelloFacebookSampleActivity in Eclipse, the layout/main.xml has error
No resource identifier found for attribute 'confirm_logout' in package 'com.facebook.samples.hellofacebook'
The offending line is
facebook:confirm_logout="false".
The facebook:confirm_logout is defined in the FacebookSDK project, not in this project.
You need to configure your Build Path properly and make sure you check the Facbook SDK Project as a Library project.These errors are generally due to misconfiguration in Build Paths.
Clean and Build again after your sure of the above.
Try going to Project > Clean all projects > OK and see if that helps.If you go to the "Problems" tab and paste the different errors you're having it might provide us with more context to help you.

Categories

Resources