Android Question Error parsing XML: mismatched tag in AndroidManifest.xml

Inman

Well-Known Member
Licensed User
Longtime User
I am trying to add Google Play Campaign Attribution to my app, using Google Analytics. I am already using Google Analytics successfully in my app using Analytics 3 library.

To track installation referrer data, I added the following to Manifest file.
B4X:
AddApplicationText(
<!-- Used for Google Play Store Campaign Measurement-->;
<service android:name="com.google.analytics.tracking.android.CampaignTrackingService" />
<receiver android:name="com.google.analytics.tracking.android.CampaignTrackingReceiver" android:exported="true" />
  <intent-filter>
    <action android:name="com.android.vending.INSTALL_REFERRER" />
  </intent-filter>
</receiver>
)

When I compile, I get the following error:
B4X:
Parsing code.                          0.10
Compiling code.                        0.10
Compiling layouts code.                0.00
Generating R file.                      Error
AndroidManifest.xml:35: error: Error parsing XML: mismatched tag

The line 35 in Manifest xml file is </receiver> from the above block of code.

What could be wrong here?
 

eps

Expert
Licensed User
Longtime User
Code from here : https://developers.google.com/analytics/devguides/collection/android/v2/campaigns

Doesn't have a / at the end of that line... HTH

B4X:
<!-- Used for install referral measurement--><serviceandroid:name="com.google.analytics.tracking.android.CampaignTrackingService"/><receiverandroid:name="com.google.analytics.tracking.android.CampaignTrackingReceiver"android:exported="true">
  <intent-filter>
    <actionandroid:name="com.android.vending.INSTALL_REFERRER"/>
  </intent-filter></receiver>
 
Upvote 0

Inman

Well-Known Member
Licensed User
Longtime User
That is v2. I used the code for v3 as that is the version the wrapper library is designed for. And it does have that incorrect / at the end.
 
Upvote 0
Top