Issue
I have an android app I'm building with Xamarin, it compiled fine before I renamed, the solution, project, and package, but now I have the following compilation error:
error APT2008: attribute 'android:name' in <service> tag must be a valid Java class name.
The error line is in the manifest generated in the debug folder:
<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>
In my manifest:
<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>
And the corresponding class:
namespace Sub.Droid
{
[Service (Name = "com.my-domain.sub.android.activiteservice")]
class ActiviteService : Service
{
...
I cleaned the project, deleted the debug and obj folders, rebuilt but the error remains.
Solution
The problem was the hyphen in the name (my-domain). Removing it alowed compilation.
Answered By - Entretoize
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.