Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
错误APT2008:属性';android:name';在<;服务>;标记必须是有效的Java类名_Android_Visual Studio_Xamarin - Fatal编程技术网

错误APT2008:属性';android:name';在<;服务>;标记必须是有效的Java类名

错误APT2008:属性';android:name';在<;服务>;标记必须是有效的Java类名,android,visual-studio,xamarin,Android,Visual Studio,Xamarin,我有一个用Xamarin构建的android应用程序,在我重命名解决方案、项目和包之前,它编译得很好,但现在我有以下编译错误: error APT2008: attribute 'android:name' in <service> tag must be a valid Java class name. 我清理了项目,删除了debug和obj文件夹,重建了它们,但错误依然存在。问题在于名称(我的域)中的连字符。在编译时删除它。谢谢分享。别忘了接受答案。 <service a

我有一个用Xamarin构建的android应用程序,在我重命名解决方案、项目和包之前,它编译得很好,但现在我有以下编译错误:

error APT2008: attribute 'android:name' in <service> tag must be a valid Java class name.

我清理了项目,删除了debug和obj文件夹,重建了它们,但错误依然存在。

问题在于名称(我的域)中的连字符。在编译时删除它。

谢谢分享。别忘了接受答案。
<service android:enabled="true" android:name=".ActiviteService" />
<service android:name="com.my-domain.sub.android.activiteservice" android:exported="false" android:directBootAware="true" />
<receiver android:name="crc6426b0443894528d3f.BlockCalls">
  <intent-filter>
    <action android:name="android.intent.action.PHONE_STATE" />
    <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
  </intent-filter>
</receiver>
<application android:label="Link" android:icon="@drawable/logo">
    <service android:enabled="true" android:name=".ActiviteService" />
    <service android:name="com.my-domain.sub.android.activiteservice" android:exported="false" android:directBootAware="true" />
</application>
namespace Sub.Droid
{
    [Service (Name = "com.my-domain.sub.android.activiteservice")]
    class ActiviteService : Service
    {
...