I am trying to add OneSignal SDK to my Android library project. Therefore, I added necessary dependencies in my library's build.gradle
and also manifestPlaceholders
:
// One Signal:
manifestPlaceholders = [onesignal_app_id: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "XXXXXXXXXXXX"]
The problem is that when I try to build a demo app which uses my library to which I added OneSignal I get these errors:
/path_to_project/demoapp/demoapp/src/main/AndroidManifest.xml Error:
Attribute meta-data#onesignal_app_id@value at AndroidManifest.xml requires a placeholder substitution but no value for <onesignal_app_id> is provided.
/path_to_project/demoapp/demoapp/src/main/AndroidManifest.xml Error:
Attribute meta-data#onesignal_google_project_number@value at AndroidManifest.xml requires a placeholder substitution but no value for <onesignal_google_project_number> is provided.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:demoapp:processDebugManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':demoapp:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
I didn't add anything manually to any AndroidManifest.xml
(neither application's nor library's).
I want to use OneSignal SDK in my library and be able to add my library to any app, so that onesignal_app_id
and onesignal_google_project_number
are the same for all apps using my library. How can I achieve this?