Android studio compile error “Content is not allowed in prolog”

后端 未结 10 2084
礼貌的吻别
礼貌的吻别 2020-11-27 08:23

I use latest Android Studio 0.8.4 (for OS X), in \"res\" directory I create new \"database\" directory and put there all files what I need and when I try to compile I receiv

相关标签:
10条回答
  • 2020-11-27 08:47

    I am having the same problem What I did is,

    You need to clear the cache data

    Go to Build(Menu)--> Clean Project

    Then

    Go to Build(Menu)--> Rebuild Project

    Then Run Your project

    This may also help in refreshing data of android preview

    0 讨论(0)
  • 2020-11-27 08:48

    Try the following steps

    1. Go to the Build Menu.
    2. Select the option Clean Project.
    3. Once again, go to the Build Menu.
    4. Select the option Rebuild Project.

    It worked for me.

    0 讨论(0)
  • 2020-11-27 08:49

    You might want to clean caches

    C:\Users\<username>\.gradle\caches
    
    0 讨论(0)
  • 2020-11-27 09:01

    I removed all of the compile statements. Then, I deleted the jar files from libs (and selected 'safe delete'). Once that was done, I dragged the jar file back into libs. Once there, I right clicked on libs selected to add it as a library. Now the gradle builds fine and everything works.

    0 讨论(0)
  • 2020-11-27 09:02

    in "res" directory I create new "database" directory

    That is not supported. You cannot invent new resource directories.

    Please put the files in res/raw/ (and use via getResources().openRawResource()) or assets/ (and use via getAssets().open()).

    0 讨论(0)
  • 2020-11-27 09:06

    I faced the same error when I created assets folder inside app/src/main/res/

    We shouldn't create folders anywhere at our will. To create new folders, make sure that you go to
    File -> Folder and consequently ,choose one of the folders among the options displayed. This way the IDE creates the folder at appropriate locations and thus accessing them doesn't raise any errors.

    0 讨论(0)
提交回复
热议问题