oce*_*kit 12 push-notification xamarin.android xamarin google-play-services
我正在使用Xamarin-Android制作一个应用程序,所以我需要将Build Action设置为我的google-services.json文件,但是没有像GoogleServicesJson那样的属性,当我尝试写它时,它会显示给我一个例外:
抛出了类型'System.Runtime.InteropServices.ExternalException'的异常.
我试图保存然后重新启动Visual Studio,但它没有解决问题.
如果您知道如何解决这个问题,请帮助我!:)
那是我点击的文件
Sus*_*ver 24
该GoogleServicesJson生成类型来自于Xamarin.GooglePlayServices.Basement.targets.
如果您的项目没有Xamarin.GooglePlayServices.Basement通过其中一个家属安装,通常Xamarin.GooglePlayServices.Gcm或者Xamarin.Firebase.Messaging如果我们正在谈论消息传递,那么您将无法使用该构建操作.
添加安装Basement的软件包或自行手动添加后,您.csproj将包含导入,Xamarin.GooglePlayServices.Basement.targets并将GoogleServicesJson作为构建类型提供:
.csproj 导入示例:
<Import Project="..\packages\Xamarin.GooglePlayServices.Basement.42.1001.0\build\MonoAndroid70\Xamarin.GooglePlayServices.Basement.targets" Condition="Exists('..\packages\Xamarin.GooglePlayServices.Basement.42.1001.0\build\MonoAndroid70\Xamarin.GooglePlayServices.Basement.targets')" />
Run Code Online (Sandbox Code Playgroud)
Ven*_*ari 14
即使在安装"Xamarin.GooglePlayServices.Basement"后,GoogleServiceJson选项也未显示.令人惊讶的是,当我退出Xamarin工作室并再次打开它时,它开始显示.
1 - 首先下载这些包:
Xamarin.Firebase.Common
Xamarin.Firebase.Config
Xamarin.Firebase.Iid
Xamarin.GooglePlayServices.Base
Xamarin.GooglePlayServices.Basement
Xamarin.GooglePlayServices.Tasks
Run Code Online (Sandbox Code Playgroud)
2 - 然后重新启动并重建3 - 来自google-services.json - >属性 - >构建操作:GoogleServicesJson
| 归档时间: |
|
| 查看次数: |
5195 次 |
| 最近记录: |