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

Configure Android namespace to fix missing namespace issue on Gradle >= 8.x #329

Closed

Conversation

h3x4d3c1m4l
Copy link

@h3x4d3c1m4l h3x4d3c1m4l commented Oct 17, 2024

Fixes:

* What went wrong:
A problem occurred configuring project ':pdftron_flutter'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

     If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

Aside from this, one should add this to the gradle.properties of the application (adding it to the library did not fix the issue):

android.nonTransitiveRClass=false

EDIT 2024-11-20: We found out PDFtron crashed in Flutter release mode, due to R8 being used in full mode by default as of Gradle 8. This fixed it for us:

android.enableR8.fullMode=false

@h3x4d3c1m4l h3x4d3c1m4l marked this pull request as draft October 17, 2024 11:29
@h3x4d3c1m4l
Copy link
Author

h3x4d3c1m4l commented Oct 17, 2024

Setting it to draft for now as I'm still investigating another build issue which seems related. fixed

@h3x4d3c1m4l h3x4d3c1m4l force-pushed the chore/gradle-8-compat branch from 3b75b36 to c6e8fdb Compare October 17, 2024 11:59
@h3x4d3c1m4l h3x4d3c1m4l force-pushed the chore/gradle-8-compat branch from c6e8fdb to b2661fe Compare October 17, 2024 12:09
@h3x4d3c1m4l h3x4d3c1m4l marked this pull request as ready for review October 17, 2024 12:10
@h3x4d3c1m4l
Copy link
Author

Anyone :) ?

@eslamwael74
Copy link
Contributor

Why has this change not been merged yet?

@NoftScarlet
Copy link

Thank you for the PR!
Hey Shirley @sgong-pdftron and Andrew @ama-pdftron, could you please take a look when you have a moment?

@brandenfung2
Copy link
Contributor

Thanks for the PR but there appears to be some compilation issues in PluginUtils.java.

I will be closing this issue in favor for #332 . The issue should be fixed in the latest version 1.0.1-38.

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

Successfully merging this pull request may close these issues.

4 participants