Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve AndroidManifest conflict for AD_SERVICES_CONFIG #660

Merged
merged 2 commits into from
Nov 24, 2024

Conversation

lottemarines
Copy link
Contributor

@lottemarines lottemarines commented Nov 24, 2024

Description

This PR resolves a conflict in AndroidManifest.xml for the property android.adservices.AD_SERVICES_CONFIG. The issue occurs when both react-native-google-mobile-ads (via play-services-ads-lite) and @react-native-firebase/analytics (via play-services-measurement-api) declare the same property, causing a build failure.

By adding tools:replace="android:resource" to the element in the react-native-google-mobile-ads manifest, this library takes precedence, resolving the conflict and allowing the project to build successfully.

Related issues

Fixes #657

Release Summary

Added tools:replace="android:resource" to in AndroidManifest.xml of react-native-google-mobile-ads.
This ensures compatibility when used with libraries like @react-native-firebase/analytics.

Checklist

  • I read the Contributor Guide
    and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in __tests__e2e__
    • jest tests added or updated in __tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

  1. Create a new bare Expo project:
$ expo init
Choose the minimal and bare template.
  1. Install the required libraries:
yarn add react-native-google-mobile-ads
yarn add @react-native-firebase/analytics
yarn add @react-native-firebase/app
yarn add expo-build-properties
  1. Apply this change and attempt to build the project for Android.
  2. Confirm that the build succeeds without requiring manual changes to the manifest.
    npx expo run:android
    => BUILD SUCCESSFUL

Copy link

docs-page bot commented Nov 24, 2024

To view this pull requests documentation preview, visit the following URL:

docs.page/invertase/react-native-google-mobile-ads~660

Documentation is deployed and generated using docs.page.

@CLAassistant
Copy link

CLAassistant commented Nov 24, 2024

CLA assistant check
All committers have signed the CLA.

@mikehardy
Copy link
Collaborator

Hey @lottemarines thank you! Can you follow the details link on the CLA Bot's comment and sign the CLA? CI is running now and if Android builds and runs successfully this should be good to go

Copy link

codecov bot commented Nov 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.79%. Comparing base (a34c7ba) to head (1f2e5e3).
Report is 80 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #660      +/-   ##
==========================================
- Coverage   43.72%   42.79%   -0.93%     
==========================================
  Files          30       30              
  Lines         549      575      +26     
  Branches      151      155       +4     
==========================================
+ Hits          240      246       +6     
- Misses        309      329      +20     
---- 🚨 Try these New Features:

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not able to commit on your fork+branch, so I left a suggestion - just an XML comment
Then it's good to go, verified works

Co-authored-by: Mike Hardy <github@mikehardy.net>
@lottemarines
Copy link
Contributor Author

@mikehardy I have added the suggested XML comment. Thank you for the suggestion!

@mikehardy mikehardy added workflow: pending merge Waiting on CI or question responses to merge, but otherwise ready and removed workflow: pending merge Waiting on CI or question responses to merge, but otherwise ready labels Nov 24, 2024
@mikehardy mikehardy merged commit 831bb8f into invertase:main Nov 24, 2024
11 of 12 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 24, 2024
### [14.4.2](v14.4.1...v14.4.2) (2024-11-24)

### Bug Fixes

* resolve AndroidManifest conflict for AD_SERVICES_CONFIG ([#660](#660)) ([831bb8f](831bb8f))
@mikehardy
Copy link
Collaborator

🎉 This PR is included in version 14.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants