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

Support Android Gradle Plugin 7.x #540

Closed
yujincheng08 opened this issue Dec 25, 2021 · 6 comments
Closed

Support Android Gradle Plugin 7.x #540

yujincheng08 opened this issue Dec 25, 2021 · 6 comments
Assignees

Comments

@yujincheng08
Copy link

AGP 7.x has updated its API drastically. For example, com.android.build.gradle.api.AndroidSourceSet has renamed to com.android.build.api.dsl.AndroidSourceSet and thus #433 no longer works.

@yujincheng08
Copy link
Author

yujincheng08 commented Dec 25, 2021

@voidzcy could you please take a look at it? My current workaround is adding the following:

fun com.android.build.api.dsl.AndroidSourceSet.proto(action: SourceDirectorySet.() -> Unit) {
    (this as? ExtensionAware)
        ?.extensions
        ?.getByName("proto")
        ?.let { it as? SourceDirectorySet }
        ?.apply(action)
}

@dev-kotlin-android
Copy link

I also encountered this problem

@voidzcy
Copy link
Collaborator

voidzcy commented Jan 4, 2022

I think we could drop support for AGP version < 4. Some non-trivial cleanups may be needed.

@yujincheng08
Copy link
Author

Any progress on this?

@dev-kotlin-android
Copy link

Any progress on this?
我已经解决了

rougsig added a commit to rougsig/protobuf-gradle-plugin that referenced this issue Jun 25, 2022
rougsig added a commit to rougsig/protobuf-gradle-plugin that referenced this issue Jun 27, 2022
@rougsig rougsig added gradle compatibility Compatibility issues with Gradle android compatibility and removed gradle compatibility Compatibility issues with Gradle labels Jul 2, 2022
ejona86 pushed a commit that referenced this issue Jul 7, 2022
Also bump java version to 11. agp 7.2.1 requires java 11.

Add AndroidSourceSet.proto extension for agp 7+. More details can be
found here:
#540

Set pipelines 30mins timeout since builds can hang when they run out
of memory. Increase memory limit from 512m to 1024m for android gradle
test runner
@yujincheng08
Copy link
Author

seems it has been fixed by 6a71480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants