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

Android debug build fails with manifest merge failure #579

Closed
haswalt opened this issue Jul 5, 2018 · 14 comments
Closed

Android debug build fails with manifest merge failure #579

haswalt opened this issue Jul 5, 2018 · 14 comments

Comments

@haswalt
Copy link

haswalt commented Jul 5, 2018

Description:

Simple project with firebase and detox installed. Added react-native-onesignal and now Android Studio can't build for debug due to manifest merge failures that seem to be caused by the one signal project. Release builds work fine. I tried adding placeholder values to defaultConfig to no avail.

                manifestPlaceholders = [
                    onesignal_app_id: "aaaa-bbbb-cccc-dddd",
                    onesignal_google_project_number: "REMOTE"
                ]

Environment

"react": "16.3.1",
    "react-native": "0.55.4",
    "react-native-firebase": "^4.2.0",
    "react-native-onesignal": "^3.2.5",

installed with npm.

Steps to Reproduce Issue:

  1. Create new react-native project
  2. Install react-native-firebase
  3. Install detox
  4. run ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug

Anything else:

Error:{REDACTED}/node_modules/react-native-onesignal/android/build/intermediates/tmp/manifest/androidTest/debug/manifestMerger7557051756214117379.xml Error:
	Attribute meta-data#onesignal_app_id@value at manifestMerger7557051756214117379.xml requires a placeholder substitution but no value for <onesignal_app_id> is provided.
{REDACTED}/node_modules/react-native-onesignal/android/build/intermediates/tmp/manifest/androidTest/debug/manifestMerger7557051756214117379.xml Error:
	Attribute meta-data#onesignal_google_project_number@value at manifestMerger7557051756214117379.xml requires a placeholder substitution but no value for <onesignal_google_project_number> is provided.
FAILURE: Build failed with an exception.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':react-native-onesignal:processDebugAndroidTestManifest'.

BUILD FAILED in 10s
@Nightsd01
Copy link
Contributor

Hi @haswalt ,

We generally see manifest merger errors during the gradle build, but it actually shouldn't cause any further issues, you should still be able to build & run your project.

@haswalt
Copy link
Author

haswalt commented Jul 6, 2018

This error prevents the build from passing and therefore tests from running. It actually breaks a significant part of our workflow completely.

I can assemble release builds but not debug test builds

@Nightsd01
Copy link
Contributor

@haswalt I haven't seen this issue in quite a while and I assumed the Android OneSignal Native SDK must have fixed something. Currently I cannot reproduce this issue.

Can you copy and paste your app/build.gradle?

@haswalt
Copy link
Author

haswalt commented Jul 7, 2018

@Nightsd01 gist of app/build.gradle: https://gist.github.com/haswalt/610182d006677ab52ce04e288cd6f97c

Note the addition of the manifest placeholders for testing. Instructions don’t include adding them, but old ones did so figured I’d see if it fixed it. It didn’t

@jkadamczyk
Copy link

@haswalt Any progress on this issue, did you figure it out?

@haswalt
Copy link
Author

haswalt commented Sep 6, 2018

@adamczyk777 nope no progress. @Nightsd01 any help?

@jkasten2
Copy link
Member

@haswalt Under the buildTypes section in your build.gradle can you try adding a debug section with the same contains as your release section?

        debug {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            defaultConfig {
                manifestPlaceholders = [
                    onesignal_app_id: "[REDACTED]",
                    onesignal_google_project_number: "REMOTE"
                ]
            }
        }

@ilyakar
Copy link

ilyakar commented Oct 5, 2018

Any progress on this? This error comes up every time I try to make a debug build

@zainozzaini
Copy link

I just replace with package com.geektime.rnonesignalandroid; at this file https://github.com/geektimecoil/react-native-onesignal/blob/master/android/src/androidTest/java/com/geektime/rnonesignalandroid/ApplicationTest.java .. and able to rebuild

@lwansbrough
Copy link
Contributor

Is anyone at OneSignal able to help with this issue? Not being able to create a debug build is blocking me.

@dorimobi
Copy link

I'm having a similar issue.
The weird thing is that it happens only when I add productFlavor.
Then it fails on this:
Task :react-native-onesignal:processDebugAndroidTestManifest FAILED
with the same error as mentioned above.
And this task doesn't even happen when there are not flavors included in the gradle.
please help!

@brettpappas
Copy link

@doridembinsky I think you hit the nail on the head. My build.gradle file uses productFlavor as well and I get the same failure to build when trying to run in the simulator. As soon as I comment out the productFlavor section it builds flawlessly.

@dorimobi
Copy link

The solution that fixed it for me was to add:

subprojects {
    afterEvaluate { subproject ->
        if (subproject.name == 'react-native-onesignal') {
            android {
                defaultConfig {
// One Signal:
                    manifestPlaceholders = [onesignal_app_id               : "",
                                            onesignal_google_project_number: ""]
                }

            }
        }
    }
}

In android/build.gradle

@Luckygirlllll
Copy link

@doridembinsky and where exactly in android/build.gradle should I add subprojects code?

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

No branches or pull requests