我使用add existing project to my project添加了另一个登录源代码项目,并在清理解决方案和重新构建后得到此错误

我将tabbar重命名为tabbar2,并将工具栏和tabbar从现有重命名为toolbar1和tabbar1
发布于 2020-12-14 04:47:45
在我的例子中,为了解决这个问题,我不得不重命名:
layout/toolbar.xml至
layout/Toolbar.xml我是从
android.support.v7.widget.Toolbar
至
androidx.appcompat.widget.Toolbar:
发自:
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />至
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />这导致了编译时出现以下错误:
Error CS0117 'Resource.Layout' does not contain a definition for 'Toolbar'将toobar.xml重命名为Toolbar.xml解决了此问题。
发布于 2020-09-10 01:35:05
我也遇到过这个问题。我在网上找到的东西我都试过了。好几天我都没能找到解决方案,所以我决定等待VS的更新。
更新是发布,我的VS是更新的-没有任何变化。
这很奇怪,但当我更改了Xamarin Diagnostics和MSBuild输出的冗长级别时-我终于得到了没有错误的构建。
因此,在VS 2019中解决了我的问题的指令:
https://stackoverflow.com/questions/61475203
复制相似问题