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

Clean up warnings when generating a new project #423

Open
ryan-conway opened this issue Mar 2, 2023 · 0 comments
Open

Clean up warnings when generating a new project #423

ryan-conway opened this issue Mar 2, 2023 · 0 comments

Comments

@ryan-conway
Copy link
Collaborator

Why

When running new_project.kts, there are several warnings in the log while the project builds:

JVM target compatibility

> Task :buildSrc:compileKotlin
'compileJava' task (current target is 11) and 'compileKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.

Deprecated APIs

WARNING:API 'BaseVariant.getApplicationIdTextResource' is obsolete and has been replaced with 'VariantProperties.applicationId'.
It will be removed in version 8.0 of the Android Gradle plugin.
For more information, see TBD.
To determine what is calling BaseVariant.getApplicationIdTextResource, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

Warning: 'kapt.use.worker.api' is deprecated and scheduled to be removed in Kotlin 1.8 release.
By default Kapt plugin is using Gradle workers to run annotation processing. Running annotation processing
directly in the Kotlin compiler is deprecated.

Namespace in manifest

package="co.myxmlproject.example.data" found in source AndroidManifest.xml: /Users/ryanconway/Projects/Nimble/MyXMLProject/data/src/main/AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

Since most of these are deprecation warnings, it makes sense to handle them now before we eventually update their dependencies to a version where they are removed.

Solution

  • Update Gradle plugin to 7.4.2
  • Update Navigation Component dependency to 2.5.3
  • Move namespace declaration from AndroidManifest.xml to build.gradle.kts
  • Remove kapt.use.worker.api from gradle.properties

Who Benefits?

Android developers

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

Successfully merging a pull request may close this issue.

1 participant