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 :
- Android: Getting "Manifest merger failed" error after updating to a new version of gradle
- 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+
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.
I did the following :
ionic cordova platform remove android
ionic cordova platform add android
ionic build android
And it worked!
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.
I changed the com.android.tools.build:gradle:3.2.1
in Top-level build file to the android studio itself version and it worked.
you can find the current studio version in Help - About
.
npm update -g ionic (update ionic CLI)
npm update -g cordova (update cordova CLI)
ionic cordova platform rm android (Remove Platform)
npm uninstall(remove Node module)
npm install(add Node module)
ionic cordova platform add android (add platform)
Then build command run:
ionic cordova build android
If you want to run app in simulator then run
Ionic cordova run android