Skip to content

Preprocessor: Android symbols not working? #708

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

Open
stephanedupont opened this issue May 15, 2025 · 5 comments
Open

Preprocessor: Android symbols not working? #708

stephanedupont opened this issue May 15, 2025 · 5 comments

Comments

@stephanedupont
Copy link

I'm trying to use Manifold as a preprocessor in a Android Studio project.

I installed manifold-ij plugin, and added this to the app build.gradle file:

dependencies {

	...

	compileOnly 'systems.manifold:manifold-preprocessor:2025.1.14'
	compileOnly 'systems.manifold:manifold-preprocessor-android-syms:2025.1.14'
}

// Manifold Javac plugin
getTasks().withType(JavaCompile) {
	options.compilerArgs += ['-Xplugin:Manifold']
}

... and preprocessor seems to work: I can define a symbol in a file and use it with a #if directive.

But I can't seem to make Android symbols working. For example, my project is in debug mode currently, and if I check the BuildConfig.java file I have this:

public final class BuildConfig {
  public static final boolean DEBUG = Boolean.parseBoolean("true");
  ...
}

... but it doesn't work:

Image

I also tested other things like #if FLAVOR, and nothing seems to work.

Did I miss some steps?

@stephanedupont stephanedupont changed the title Android symbols not working Preprocessor: android symbols not working? May 15, 2025
@stephanedupont stephanedupont changed the title Preprocessor: android symbols not working? Preprocessor: Android symbols not working? May 15, 2025
@rsmckinney
Copy link
Member

Hi @stephanedupont. Android Studio varies depending on JDK target. You might try:

    annotationProcessor 'systems.manifold:manifold-preprocessor:2025.1.14'
    annotationProcessor 'systems.manifold:manifold-preprocessor-android-syms:2025.1.14'

    testAnnotationProcessor 'systems.manifold:manifold-preprocessor:2025.1.14'
    testAnnotationProcessor 'systems.manifold:manifold-preprocessor-android-syms:2025.1.14'

Let me know if that doesn't work for you.

@stephanedupont
Copy link
Author

Thank you @rsmckinney. Unfortunately, that still doesn't work.

@stephanedupont
Copy link
Author

@rsmckinney: is there a way to debug what's happening?

@rsmckinney
Copy link
Member

@stephanedupont sorry for the delay. Can you provide more context re your environment: OS, manifold version, manifold IJ plugin version, intellij/studio version, etc. Thanks!

@stephanedupont
Copy link
Author

Thank you @rsmckinney.

OS: Windows 11
Android Studio Meerkat Feature Drop | 2024.3.2
manifold-ij version 2024.1.29

compileOnly 'systems.manifold:manifold-preprocessor:2025.1.14'
compileOnly 'systems.manifold:manifold-preprocessor-android-syms:2025.1.14'

(I'm available for sharing my screen if you need to debug the session.)

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