Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find manifest-merger.jar (com.android.tools.build:manifest-merger:26.0.1)

I have a unity project I am exporting that project as android studio project while opening the android studio project I am getting this error

Gradle sync failed: Could not find manifest-merger.jar     (com.android.tools.build:manifest-merger:26.0.1).     Searched in the following locations:     https://jcenter.bintray.com/com/android/tools/build/manifest-merger/26.0.1/manifest-merger-26.0.1.jar 

I have a few old exported project that was working fine before but today they are also giving the same error.

like image 261
Ayush Malviya Avatar asked Jan 14 '19 12:01

Ayush Malviya


People also ask

How do I See my merged manifest in Android Studio?

List of permissions the merger tool may add to the merged manifest Even before you build your app, you can see a preview of what your merged manifest looks by opening your AndroidManifest.xml file in Android Studio, and then clicking the Merged Manifest tab at the bottom of the editor.

What is the manifest file for Android app?

For an introduction to the app manifest file, see the app manifest overview. Your APK or Android App Bundle file can contain just one AndroidManifest.xml file, but your Android Studio project may contain several—provided by the main source set, build variants, and imported libraries.

How does the manifest merge tool work?

The manifest merger tool combines all XML elements from each file by following some merge heuristics and by obeying merge preferences that you have defined with special XML attributes. This page describes how manifest merging works and how you can apply merge preferences to resolve merge conflicts.

Can the manifest file override the main manifest file?

However, for each assembly step, only one value of each flavor group and build type can be selected, leading to an ordered list of possible manifest files that overrides the main manifest file. For instance, the following FlavorGroups: abi, density, API, Prod/Internal leads to the following matrix of possible flavors :


2 Answers

I finally fixed the issue. This may be a workaround but it works. So if anyone having this issue, just follow this:

  1. Swap the position of jcenter() and google() in project gradle file and in also all the other module you have in your project. Like in mine I have crashlytics, fabric so just remember to make the changes in their build.gradle file as well:

    buildscript {     repositories {         jcenter()         google()     } } 

    to

    buildscript {     repositories {         google()         jcenter()     } } 
  2. Before building your project again go to your project folder and delete the .gradle folder from your project and then build your project.

like image 185
Ayush Malviya Avatar answered Sep 29 '22 05:09

Ayush Malviya


  1. Go to Publishing Settings/Build, enable Custom Gradle Template
  2. Go to Assets/Plugins/Android/mainTemplate.gradle and change the postion from
  buildscript {     repositories {         jcenter()         google() } 

to

  buildscript {    repositories {       google()       jcenter() } 
  1. Remove gradle cache and rebuild. For Mac you can run rm -rf $HOME/.gradle/caches/ in terminal.
like image 30
Vincent Plus Avatar answered Sep 29 '22 07:09

Vincent Plus