tyczj tyczj - 1 year ago 136
Android Question

Android Studio 2.2 layout files have wrong information

I upgraded android studio to 2.2 a little while ago and when I went to opened one of my projects all of my layout files are messed up along with some of my classes

for example one of my layout files looks like this in android studio

���� 3�
��� actionBarDivider I
ConstantValue E actionBarItemBackground F actionBarPopupTheme ?
actionBarSize D actionBarSplitStyle A actionBarStyle @ actionBarTabBarStyle ; actionBarTabStyle : actionBarTabTextStyle < actionBarTheme B actionBarWidgetTheme C actionButtonStyle ` actionDropDownStyle \ actionLayout � actionMenuTextAppearance G actionMenuTextColor H actionModeBackground K actionModeCloseButtonStyle J actionModeCloseDrawable M actionModeCopyDrawable O actionModeCutDrawable N actionModeFindDrawable S actionModePasteDrawable P actionModePopupWindowStyle U actionModeSelectAllDrawable Q actionModeShareDrawable R actionModeSplitBackground L actionModeStyle I actionModeWebSearchDrawable T actionOverflowButtonStyle = actionOverflowMenuStyle > actionProviderClass � actionViewClass � activityChooserViewStyle h alertDialogButtonGroupStyle � alertDialogCenterButtons � alertDialogStyle � alertDialogTheme �
allowStacking � alpha � arrowHeadLength � arrowShaftLength � autoCompleteTextViewStyle �
background backgroundSplit backgroundStacked
backgroundTint@ backgroundTintModeA barLength � borderlessButtonStyle e buttonBarButtonStyle b buttonBarNegativeButtonStyle � buttonBarNeutralButtonStyle � buttonBarPositiveButtonStyle � buttonBarStyle a
buttonGravity5 buttonPanelSideLayout ! buttonStyle � buttonStyleSmall �
buttonTint � buttonTintMode �
checkboxStyle � checkedTextViewStyle � closeIcon � closeItemLayout collapseContentDescription7 collapseIcon6 color � colorAccent � colorBackgroundFloating � colorButtonNormal � colorControlActivated � colorControlHighlight � colorControlNormal � colorPrimary � colorPrimaryDark � colorSwitchThumbNormal �
commitIcon � contentInsetEnd contentInsetEndWithActions contentInsetLeft contentInsetRight contentInsetStart contentInsetStartWithNavigation controlBackground � customNavigationLayout defaultQueryHint � dialogPreferredPadding Z dialogTheme Y displayOptions divider dividerHorizontal g dividerPadding � dividerVertical f drawableSize � drawerArrowStyle dropDownListViewStyle y dropdownListPreferredItemHeight ] editTextBackground n
editTextColor m
editTextStyle � elevation $expandActivityOverflowButtonDrawable gapBetweenBars � goIcon � height hideOnContentScroll homeAsUpIndicator _
homeLayout icon iconifiedByDefault � imageButtonStyle o indeterminateProgressStyle initialActivityCount isLightTheme itemPadding layout � listChoiceBackgroundIndicator � listDividerAlertDialog [ listItemLayout %
listLayout " listMenuViewStyle � listPopupWindowStyle z listPreferredItemHeight t listPreferredItemHeightLarge v listPreferredItemHeightSmall u listPreferredItemPaddingLeft w listPreferredItemPaddingRight x logo

some layout files actually have code from my classes in them...

If I look at the xml files on disk the layout is correct (which is good news) along with the classes

has anyone else seen this problem and know how to fix it? Cleaning the project didnt do anything

Answer Source

Since, this appears to be an issue where the file contents of a normal file cannot be rendered properly by the tool, I suggest to try following:

File > Invalidate Cache/Restart > Invalidate and Restart

However, I do not understand the true cause for this issue. If you can reproduce the issue, you may want to file a bug report here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download