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

Is it supposed to work on AGP 4.1? #2

Closed
LouisCAD opened this issue Sep 16, 2020 · 8 comments
Closed

Is it supposed to work on AGP 4.1? #2

LouisCAD opened this issue Sep 16, 2020 · 8 comments

Comments

@LouisCAD
Copy link
Member

Hello,

I'm using AGP 4.1-rc02 and I get the following error in a leaf Android module:

Caused by: com.android.builder.errors.EvalIssueException: Manifest file does not exist:

I have the following configuration in the root project's build.gradle.kts:

plugins {
    id("com.gradleup.auto.manifest") version "1.0.2"
}

autoManifest {
    packageName.set("com.company")
    replaceDashesWithDot.set(true)
}

I see the plugin has been built with AGP 3.6.3. Did you ever try it in a project using AGP 4.1? Might be caused by a change in ordering in recent AGP versions?

@tasomaniac
Copy link
Member

While working on this AGP 4.1 was early alpha and it was working. I didn't check with RCs.

I actually want to use the new transformation APIs available in 4.1 but they did not quite work at the time. Actually I heard in Slack that the API is going to break in 4.2 and 5.0.

Anyways, thanks for reporting this. I will have a look soon.

@LouisCAD
Copy link
Member Author

Thanks for your response and consideration!

FYI, I have been trying with AGP 4.1-rc02 but in AS 4.2 Canary 10.
I don't think that should change the behavior, but in case you are not reproducing in AS 4.1 RC2/3, then this might be good to know.

@tasomaniac
Copy link
Member

Hey, sorry for late reply on this. I found one issue and going to push a fix for that.

I was not able to reproduce this error on the sample app. I will try in Splitties.

@tasomaniac
Copy link
Member

I think the issue on Splitties was because of the following line: https://github.com/LouisCAD/Splitties/blob/main/buildSrc/src/main/kotlin/config/AndroidLibraryConfig.kt#L27

@tasomaniac
Copy link
Member

tasomaniac commented Nov 10, 2020

For those who are curious, I've integrated it into Splitties. This library is even more useful for Kotlin Multiplatform projects (Splitties is one of them) since you have to put the manifest under main folder which is not really a valid folder at all in Kotlin Multiplatform.

Splitties was changing it manually to be consistent with androidMain in KMM. It is mostly not needed anymore.

Checkout the PR for more details: LouisCAD/Splitties#260

@LouisCAD
Copy link
Member Author

Thanks for digging @tasomaniac!
Do you know if the plugin could play nicely with custom defined manifest files, or if it could detect it and show a proper error message with resolution suggestion?

@tasomaniac
Copy link
Member

It's tricky. What I can do is to hardcore the original path used by Android Gradle Plugin and compare. AGP does not have any API on this and if they change it, my plugin would be broken. But the fact is that it did not change in 10 years 😊

@tasomaniac
Copy link
Member

I gave another thought on this.

If you have custom defined manifest file and that file exists, the plugin already detects that and it wouldn't be a problem.

The problem with Splitties was that the custom path for Manifest was defined for all modules. When integrating auto-manifest, since the natural thing to do is to delete those one-liner files, it was erroring.

Not sure if we can handle that. I will add info into Readme tho.

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

2 participants