gpt4 book ai didi

android - Xamarin中的Build错误缺少youtube软件包

转载 作者:行者123 更新时间:2023-12-03 06:14:57 27 4
gpt4 key购买 nike

尝试构建android xamarin项目时出现以下错误。我以前从未遇到过这个问题,也不清楚如何解决它。谁有想法?有没有添加依赖项的方法?我什至在这里思考正确吗?

... Android / obj / Debug / android / src / md548954d6403a7d9a6fe546c5860c66901 / BenefitDetailFragment.java(50,50):错误:错误:包com.google.android.youtube.player.YouTubePlayer不存在
com.google.android.youtube.player.YouTubePlayer.OnInitializedListener,
(* .Android)javac

这是我的初始化代码:

    public void OnInitializationFailure(IYouTubePlayerProvider provider, YouTubeInitializationResult errorReason)
{

if (errorReason.IsUserRecoverableError)
{
errorReason.GetErrorDialog(Activity, RECOVERY_REQUEST).Show();
}
else
{
String error = String.Format("Something went wrong with youtube player.", errorReason.ToString());
ShowSnackBar(Activity, error, linearMoreInfo, Resource.Color.colorAccent);

}

}

public void OnInitializationSuccess(IYouTubePlayerProvider p0, IYouTubePlayer player, bool wasRestored)
{
mPlayer = player;
if (!wasRestored)
{
player.SetOnFullscreenListener(this);
if (!String.IsNullOrEmpty(videoId))
{
player.CueVideo(videoId);
}
else
{
player.CueVideo("wKJ9KzGQq0w");
}
}
}

最佳答案

我通过将YouTubeAndroidPlayerApi.jar的Build Action更改为EmbeddedJar解决了该问题

关于android - Xamarin中的Build错误缺少youtube软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45419447/

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