gpt4 book ai didi

android - Xamarin:无法在中构建干净的 Android Wear 项目

转载 作者:行者123 更新时间:2023-11-30 00:16:33 25 4
gpt4 key购买 nike

我正在尝试使用 xamarin 创建一个 Android Wear 项目,但我无法运行我的项目。我将所有包都更新到了最新版本

我的 android wear 项目是一个独立的应用程序,所以我将最低 SDK 版本设置为 23。

这些是我在我的 android wear 项目中使用的最重要的包:

  • Xamarin.GooglePlayServices.Wearable:v42.1021.1
  • Xamarin.Android.Wear:v2.0.1.1
  • Xamarin.Android.Support.Wear:v26.1.0.1
  • Xamarin.Android.Support.v4:v26.1.0.1

我在开始我的项目时总是遇到以下异常:

1>obj\Debug\android\src\mono\android\support\wear\widget\SwipeDismissLayout_OnDismissedListenerImplementor.java:8: error: package android.support.wear.widget.SwipeDismissLayout does not exist
1> android.support.wear.widget.SwipeDismissLayout.OnDismissedListener
1> ^
1>obj\Debug\android\src\mono\android\support\wear\widget\SwipeDismissLayout_OnPreSwipeListenerImplementor.java:8: error: package android.support.wear.widget.SwipeDismissLayout does not exist
1> android.support.wear.widget.SwipeDismissLayout.OnPreSwipeListener
1> ^
1>obj\Debug\android\src\mono\android\support\wear\widget\SwipeDismissLayout_OnSwipeProgressChangedListenerImplementor.java:8: error: package android.support.wear.widget.SwipeDismissLayout does not exist
1> android.support.wear.widget.SwipeDismissLayout.OnSwipeProgressChangedListener
1> ^
1>Note: Some input files use or override a deprecated API.
1>Note: Recompile with -Xlint:deprecation for details.
1>Note: Some input files use unchecked or unsafe operations.
1>Note: Recompile with -Xlint:unchecked for details.
1>3 errors
1> error: package android.support.wear.widget.SwipeDismissLayout does not exist
1> android.support.wear.widget.SwipeDismissLayout.OnDismissedListener
1>
1> error: package android.support.wear.widget.SwipeDismissLayout does not exist
1> android.support.wear.widget.SwipeDismissLayout.OnPreSwipeListener
1>
1> error: package android.support.wear.widget.SwipeDismissLayout does not exist
1> android.support.wear.widget.SwipeDismissLayout.OnSwipeProgressChangedListener
1>
1>Done building project "NormalWearTest.csproj" -- FAILED.
1>Build FAILED.

这是问题所在的文件(SwipeDismissLayout_OnDismissedListenerImplementor.java):

package mono.android.support.wear.widget;


public class SwipeDismissLayout_OnDismissedListenerImplementor
extends java.lang.Object
implements
mono.android.IGCUserPeer,
android.support.wear.widget.SwipeDismissLayout.OnDismissedListener
{
/** @hide */
public static final String __md_methods;
static {
__md_methods =
"";
mono.android.Runtime.register ("Android.Support.Wear.Widget.SwipeDismissLayout+IOnDismissedListenerImplementor, Xamarin.Android.Support.Wear, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", SwipeDismissLayout_OnDismissedListenerImplementor.class, __md_methods);
}


public SwipeDismissLayout_OnDismissedListenerImplementor ()
{
super ();
if (getClass () == SwipeDismissLayout_OnDismissedListenerImplementor.class)
mono.android.TypeManager.Activate ("Android.Support.Wear.Widget.SwipeDismissLayout+IOnDismissedListenerImplementor, Xamarin.Android.Support.Wear, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "", this, new java.lang.Object[] { });
}

private java.util.ArrayList refList;
public void monodroidAddReference (java.lang.Object obj)
{
if (refList == null)
refList = new java.util.ArrayList ();
refList.add (obj);
}

public void monodroidClearReferences ()
{
if (refList != null)
refList.clear ();
}
}

我在 Github 上添加了完整的代码示例

最佳答案

如果您不使用 Xamarin.Android.Support.Wear 包,请删除它,删除此包后,它在我这边工作正常。

关于android - Xamarin:无法在中构建干净的 Android Wear 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47153272/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com