Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.0) in ionic3?

I have got above error after generating build in ionic3 I have tried a lot of solution but not working tell me, anyone, how to fix above error? below I have to include //Project-properties file. I have tried below solution but did not work for me :

  1. Android: Getting "Manifest merger failed" error after updating to a new version of gradle
  2. https://forum.ionicframework.com/t/solved-ionic-run-android-com-android-support-conflicting-v26-alpha1-and-v25-3-1/91826/19

//Project-properties file
target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.razorpay:checkout:1.4.6
cordova.system.library.2=com.android.support:support-v4:24.1.1+
cordova.system.library.3=com.google.firebase:firebase-core:+
cordova.system.library.4=com.google.firebase:firebase-messaging:+
cordova.gradle.include.1=cordova-plugin-fcm/app-FCMPlugin.gradle
cordova.system.library.5=com.android.support:support-v4:25.+
cordova.system.library.6=com.android.support:appcompat-v7:25.+
cordova.system.library.7=com.android.support:support-v4:24.1.1+
cordova.gradle.include.2=phonegap-plugin-barcodescanner/app-barcodescanner.gradle
cordova.system.library.8=com.squareup.okhttp3:okhttp:3+
like image 850
Kapil Soni Avatar asked Dec 27 '18 12:12

Kapil Soni


3 Answers

This solution worked for me

1- In the CordovaLib folder and in the build.gradle file, change the position of the Maven up

Repositories {
   maven {
         url "https://maven.google.com"
   }
   jcenter()
}

2- In the general build.gradle file of the project change the position of Maven up and add google()

Repositories {
   maven {
         url "https://maven.google.com"
   }
   google()
   jcenter()
}

3- In the build.gradle file of the APP folder change the position of Maven up and add google()

buildscript {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        google()
        mavenCentral()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
    }
}

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
    repositories {
        google()
        mavenCentral();
        jcenter()
    }
}

4 - Finally, run the "Make Project" that is in the upper corner of Android Studio. View the image here

like image 109
Danielly Queiroz Avatar answered Nov 20 '22 16:11

Danielly Queiroz


I did the following :

ionic cordova platform remove android ionic cordova platform add android ionic build android

And it worked!

like image 22
Nicolas Avatar answered Nov 20 '22 16:11

Nicolas


Thanks! Had the same issue with cordova project build--setting maven repository as the first entry in both \platforms\android\build.gradle and \platforms\build.gradle files.

like image 1
LeeX Avatar answered Nov 20 '22 18:11

LeeX