Android gradle build issue - android

strong textI getting the below error, even though I removed "apt" from the gradle files.
android-apt plugin is incompatible with the Android Gradle plugin.
Please use 'annotationProcessor' configuration instead.
Currently using gradle 3.1.0

Related

Adding Gradle Dependency Breaks Gradle Build

I added the stripe sdk to my kotlin app and can no longer build my application.
Addition to grade file:
implementation 'com.stripe:stripe-android:16.8.2'
Build error:
/Users/username/.gradle/caches/transforms-2/files-2.1/6fabb8e15860d0b2ea75a56e95ee9aa5/jetified-kotlin-stdlib-common-1.5.0.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.16.
Removing the stripe dependency fixes the issue. I also tried deleting the cache folder referenced in the error message and it was just recreated and the issue persisted.
The problem seems to be a mismatch between the kotlin library used in your project and the version of the plugin that is not compatible.
Upgrade your Gradle version by going to File>Project Structure.
Ps:(also try downgrading your kotlin version to one of the 1.4.x versions)
Another developer ran into this same issue and solved it by upgrading Gradle
I updated my gradle like this
// id 'org.jetbrains.kotlin.android.extensions' deprecated
id 'kotlin-parcelize'
and in project gradle add this
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32"
so now it works.

Android Gradle Plugin: Property 'applicationId' is not annotated with an input or output annotation

I recently upgraded my Android Studio (and Gradle Plugin) to version 4.0, and now when I build my project I get:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use --warning-mode all to show the individual deprecation warnings.
Then, when I set org.gradle.warning.mode=all in gradle.properties, I get this below :app:generateSafeArgsDebug task:
Property applicationId is not annotated with an input or output annotation. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0.
Property applicationIdResource is not annotated with an input or output annotation. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0.
I've read Gradle version 6.1.1 and plugin version 4.0.0 in android studio in Gradle Forums, which suggests that the problem could be caused by outdated dependencies, but I have all the latest versions and the problem remains.
How can I fix this warning?
"androidx.navigation:navigation-safe-args-gradle-plugin" is the cause of the "app:generateSafeArgsDebug" task.
By upgrading it (to the 2.3.1 version, for example), theses warnings will disappear.
Other warnings will raise:
WARNING: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
It will be removed in version 5.0 of the Android Gradle plugin.
WARNING: API 'BaseVariant.getApplicationIdTextResource' is obsolete and has been replaced with 'VariantProperties.applicationId'.
It will be removed in version 5.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.
But maybe easier to solve (and less stacktrace-styled)

Firebase Performance configuration fails with v1.1.2 when using implementation or api

I'm trying to upgrade my firebase-plugins dependency version to 1.1.2 which supports the Android Gradle Plugin version 3+, but the Gradle build configuration keeps failing unless I use compile which is deprecated. I'm using Play Services version 11.4.2 and and I have the firebase-perf dependency added like so which fails:
implementation "com.google.firebase:firebase-perf:$playServicesVersion"
The only way to fix it is to change the above implementation to compile. Has anyone found a solution to get around this? (Aside from downgrading to firebase-plugins version 1.1.0-alpha1?)
Here's the error message:
* What went wrong:
A problem occurred configuring project ':app'.
> To use the Firebase Performance Plugin, the Firebase Performance Monitoring SDK must be added to the app's build.gradle. Please add compile 'com.google.firebase:f
irebase-perf:VERSION_NUMBER_GREATER_THAN_OR_EQUAL_TO_11.0.4' to the app's build.gradle.
Edit: this has been fixed in firebase-plugins:1.1.3.
This error is because firebase-perf plugin is specifically looking for the presence of 'compile' configuration for com.google.firebase:firebase-perf SDK. If the SDK is not included in build.gradle at build time, there will be a run time crash later.
Android Studio 3.0 replaces 'compile' with 'implementation', the plugin code should instead checking 'implementation' configuration for firebase-perf SDK.
The workaround now is to continue using:
compile "com.google.firebase:firebase-perf:$playServicesVersion"
This will be fixed in the future firebase-plugins release.

Which version of android gradle plugin i can use with gradle 2.14?

I found a table here http://tools.android.com/tech-docs/new-build-system/version-compatibility but it has no entry for gradle 2.14. I am trying to build an app without an IDE with gradle
but it has no entry for gradle 2.14
Do not use Gradle 2.14. Use Gradle 2.14.1. If Gradle issues a patch level release, that's probably due to a critical bug.
Then, you are covered by the last row in the table, simulated below because Stack Overflow does not like teh tabelz:
Android Gradle Plugin Requires Gradle
2.1.3+ 2.14.1+
So, if you want to use Gradle 2.14.1, use version 2.1.3 or higher of the Android Plugin for Gradle.

Getting error "Gradle version 1.10 is required. Current version is 1.12." when executing "gradle wrapper"?

I'm trying to execute gradle wrapper for an Android project, and this error is raised:
A problem occurred evaluating root project 'myapp'.
> Gradle version 1.10 is required. Current version is 1.12. If using the gradle wrapper, try editing the distributionUrl in /Users/dude/myapp/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip
My wrapper task in build.gradle looks like this:
task wrapper(type: Wrapper) {
gradleVersion = "1.12"
}
I recently updated to Gradle v1.12 via Homebrew. Is it not supported or something? If so, where can I check this sort of thing?
A particular version of the Gradle Android plugin requires a particular version of Gradle (at least for now), and it seems that your version of the Gradle Android plugin requires Gradle 1.10. You might find more information on this in the documentation for the Gradle Android plugin.
PS: The wrapper task above creates the files necessary to run Gradle with the (generated) gradlew script, which is the preferred way to run Gradle (no manual install, every build can specify in its gradle-wrapper.properties which Gradle version it needs).
The version of Android gradle plugin needs to be compatible with the version of Gradle. Checkout the version compatibility mapping table hereļ¼š
http://tools.android.com/tech-docs/new-build-system/version-compatibility
I had the same problem. It turned out that the old Android Studio created gradle related files one level above my application folder. In my case, the path was in ~/git/, and my project was at ~/git/myproject. I used Android Studio RC2 now, and no matter how I changed the config within the project, gradle still wanted to use the old 1.10 version. Therefore, I re-checked out the project a new path, and updated the gradle version reference within the project, then it compiled.

Categories

Resources