-
Notifications
You must be signed in to change notification settings - Fork 1k
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
bug: Android build variables are replaced during sync #3026
Comments
can you provide a sample app? |
Sure, there is an example project: https://github.com/robingenz/capacitor-issue-3026-example This example project does NOT include several product flavors. Required steps:
in
in |
onesignal plugin has the permission declared as capacitor CLI replaces |
Okay, now I understand the problem. In my opinion, an adjustment to the Capacitor CLI is recommended here. From the Cordova documentation:
So |
I've created a PR for this: #3030 |
Are there any open questions or can I still help in any way? |
I am facing the same issue. Are there any outstanding tasks? |
No, I'll add your changes as I think it makes more sense to use the |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Bug Report
My Android project has several product flavors. Each product flavor has a different
applicationId
.I need build variables to set the correct values in the android manifest. Unfortunately these build variables are replaced by static values during sync.
Affected Platform(s)
Current Behavior
During
ionic capacitor sync ancdroid
, Android build variables are replaced by static values.Example:
My android project has two flavors:
io.ionic.first
andio.ionic.second
.android/app/src/main/AndroidManifest.xml
contains these lines:android/app/build.gradle
contains these lines:After
ionic capacitor sync android
the fileandroid/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml
looks like this:${applicationId}
was replaced byio.ionic.first
.This means that if I now build an app with the application id
io.ionic.second
, it contains the permissionio.ionic.first.permission.RECEIVE_ADM_MESSAGE
.But this should not be the case, because it can lead to conflicts between the apps.
For example:
Capacitor Version
npx cap doctor
output:Expected Behavior
After
ionic capacitor sync android
the fileandroid/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml
should contain the following lines:Sample Code or Sample Application Repo
Reproduction Steps
npx ionic build
AndroidManifest.xml
, for exmapleOneSignal
(https://documentation.onesignal.com/docs/ionic-sdk-setup).npx ionic capacitor sync android
Other Technical Details
npm --version
output: 6.14.5node --version
output: v13.12.0Other Information
The text was updated successfully, but these errors were encountered: