android.view.inflateexception binary xml file line #1 error inflating class android.widget.relativeLayout

前端 未结 7 1276
春和景丽
春和景丽 2021-02-07 07:56

I am new in android.
I just made a new layout with one text bar and 2 buttons but it didn\'t work, I am posting the stack trace and my relative layout file any idea about th

7条回答
  •  鱼传尺愫
    2021-02-07 08:32

    What fixed it in my case was to change the location of my color.xml

    As I copied it from some other project of mine and pasted it in the new project, Android Studio placed it in the v21 folder, meaning my emulator (v19) could not reach the resource file color.xml.

    I did the following to fix it:

    1. Right click on color.xml.
    2. Select Refactor > Move.
    3. On the dialog that open, removed the suffix -v21.

    Now, my "old" emulator was able to read the file.

    I hope it helps..

提交回复
热议问题