Re: Android Studio manifest merge

2,506 views
Skip to first unread message

Xavier Ducrohet

unread,
May 20, 2013, 2:13:45 PM5/20/13
to adt...@googlegroups.com
The Gradle based build system already supports manifest merging.


On Mon, May 20, 2013 at 5:08 AM, Yura Bereza <ybe...@gmail.com> wrote:
Is there is a way to enable manifest merge in new Android Studio 0.1? Intellij IDEA 12.x does not support manifest merge, but as i know there were a plans to enable this feature in 13 version (on which Android Studio is based)

--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Yura Bereza

unread,
May 20, 2013, 3:37:53 PM5/20/13
to adt...@googlegroups.com
Thanks, Xavier!

понедельник, 20 мая 2013 г., 22:13:45 UTC+4 пользователь Xavier Ducrohet написал:

Xavier Ducrohet

unread,
May 21, 2013, 2:37:32 PM5/21/13
to adt...@googlegroups.com
I have no idea what android-validator means so I'm guessing this is IntelliJ's android builder.

There should be a settings.gradle file created somewhere at the root of all the project you selected. Next to it, should be a build.gradle (but it's likely to be missing, just add it manually).

Then in Studio, choose import project and select this top-level build.gradle file. Do not import the Eclipse project.

We're fixing the export from ADT to be a bit more robust and create this file for you.


On Tue, May 21, 2013 at 12:17 AM, Sime Amizic <sam...@rhapsody.com> wrote:
HI Xavier,

I am having problems with running a project in AndroidStudio using merge.manifest after exporting it from Eclipse. In fact, build process completes, but it still shows an Warning message:

android-validator: [RhapsodyApp1] Manifest merging is not supported. Please, reconfigure your manifest files

Does this mean AndroidStudio is still building the project using ant?

 I have downloaded the latest Androit Tools v22 and have exported gradle files using Eclipse as described on AndroidDevelopers site. That action resulted in  creating only a single file per project: build.gradle.
This tells me that something might be wrong since the project structure of projects that are freshly created in Android Studio has a lot more project files and a completely differend folder structure.

Thanks for the clarification.

Sime Amizic

unread,
May 21, 2013, 7:09:03 PM5/21/13
to adt...@googlegroups.com
Yes, android-validator is a tag displayed in the console by Intellij's android builder.

Export gradle files command does not generate settings.gradle file in the root of the selected project when exporting gradle files using Eclipse. It only generates build.gradle.

The problem was caused by the fact that in my previous attempts I was trying to import projects by selecting the project folder, not by selecting build.gradle file!

However, during the initialization of gradle project I am getting another error message: "Unable to create folder {project_root}\build.gradle\.idea"

On windows, the problem occurs when a folder named build.gradle is getting created which is not possible because the root already contains a file with the same name.

Trying to find a workaround, but no success yet.

Currently I'm stuck. Will let you know if I find something that helps.

Thanks,
Sime

Xavier Ducrohet

unread,
May 21, 2013, 8:21:13 PM5/21/13
to adt...@googlegroups.com
what import action are you using?

settings.gradle is only created if you have more than one project, and it's created in the parent folder of both projects.

Sime Amizic

unread,
May 22, 2013, 2:30:02 AM5/22/13
to adt...@googlegroups.com

I am using File > Import Project, then select build.gradle file in the root of the runnable Android project.

There are 9 projects in the eclipse workspace (One is runnable application and other are library projects it depends on). There is no settings.gradle file being generated when Export gradle files is done.

It's also strange that generated build.gradle file doesn't contain any dependencies. And project should have a dosen jars and a library project as a dependency.

Here it is.

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.4'
    }
}
apply plugin: 'android-library'

dependencies {
}

android {
    compileSdkVersion 17
    buildToolsVersion "17"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 17
    }
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        instrumentTest.setRoot('tests')
    }
}

Sime Amizic

unread,
May 22, 2013, 2:40:47 AM5/22/13
to adt...@googlegroups.com

If I try to use the other Import procedure, as described here: MigratingFromEclipse. When I import a project by selecting the project root I immediately get two error messages in the Event Log:

Error importing module RhapsodyApp: Manifest merging is not supported. Please, reconfigure your manifest fils

and

IllegalArgumentException: Error during dispatching of java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil$3@7b247545,notifier=null,catchExceptions=false,when=1369204522436] on sun.awt.windows.WToolkit@630ed791: Argument 1 for @NotNull parameter of com/android/tools/idea/gradle/service/GradleProjectDataService.customizeModule must not be null


I am reporting the second issue to google using a built-in dialog.

Regards,
Sime

On Tuesday, May 21, 2013 5:21:13 PM UTC-7, Xavier Ducrohet wrote:

Xavier Ducrohet

unread,
May 22, 2013, 11:32:45 PM5/22/13
to adt...@googlegroups.com
If you get an error about manifest merging not being supported, it's that you imported the eclipse project instead of the gradle file.

We found some issues in the gradle export from ADT and we have worked out a fix. We're looking at publishing an update soon.

Sime Amizic

unread,
May 23, 2013, 2:30:04 PM5/23/13
to adt...@googlegroups.com

Exactly, that was my conclusion too (project imported as non-gradle based).

Looking forward to your update. Thanks for the help!
Reply all
Reply to author
Forward
0 new messages