Error package android support annotation does not exist

Learn how to fix package android.support.annotation does not exist error when building your application

When building your Android application, you might find an error saying that the package android.support.annotation does not exist.

Here’s an example of the error:

error: package android.support.annotation does not exist
error: cannot find symbol class NonNull
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

Usually, the error above happens when you migrate your Android application to use androidx libraries.

androidx is the namespace used by Android Jetpack libraries. It’s a group of Android support libraries that help you in developing an Android application.

The androidx packages fully replace the android.support packages, and new features will be added to androidx.

When you use androidx, you need to update your Android source code and replace all import statements for android.support.annotation package with androidx.annotation package.

Here’s an example of replacing the import statement that uses FloatRange annotation:

// import android.support.annotation.FloatRange;
import androidx.annotation.FloatRange;

public class Color {
    @FloatRange(from=0.0,to=1.0)
    public float makeOpaque() {
        return (float) 0.5;
    }
}

Instead of replacing the import lines one by one, you can try to use the Android Studio’s AndroidX migration feature to help you automate the process.

Before you migrate to AndroidX, please update your annotation library dependencies to version 28.0 first:

dependencies {
    implementation 'com.android.support:support-annotations:28.0.0'
}

This is required because AndroidX version 1.0.0 is equivalent to support library version 28.0.0.

If you use lesser support library versions, other errors may occur when building your application after migration.

To start the migration, add the following two lines to your gradle.properties file:

android.useAndroidX=true
android.enableJetifier=true

Next, select Refactor > Migrate to AndroidX from your Android Studio top menu.

Once you complete the review and let Android Studio do the refactor, the required androidx dependencies should be added to your build.gradle file.

You should also see the import lines being replaced with the new ones.

If you still see the build error after migrating to AndroidX, then you need to replace the import statements manually.

Right-click on your application package to open the context menu, then select the Replace in Files… menu as shown below:

In the pop-up window, aim to replace android.support.annotation with androidx.annotation for all of your files.

The following screenshot should help:

Click Replace if you want to review the refactor one by one, or click on Replace All to refactor all occurrences at once.

The issue with the annotations library should now be resolved.

Resolve annotation error in React Native applications

If you’re building an Android application using React Native, then you need to also run the jetifier package after doing all of the steps above.

Note: You need to migrate the React Native Android application using Android Studio by opening the android/ folder in Android Studio.

When you migrate your native Java code using Android Studio, the React Native modules in the node_modules folder may still contain code that uses the Android support library.

The jetifier module refactors Java code included in your React Native application to use androidx instead of android.support namespaces.

After migrating to AndroidX using Android Studio, run the following steps with NPM:

npm install --save-dev jetifier
npx jetify

Or if you use Yarn:

yarn add jetifier
yarn jetify

The import statements in your node_modules folder that uses old Android support libraries will be replaced with androidx.

Once done, you should be able to run your React Native app:

npx react-native run-android

You might also want to include the call to jetify in your postinstall script:

"scripts": {
    "postinstall": "jetify"
}

When you update your Node module dependencies with npm install or npm update, you need to run the jetify command again.

Adding jetify as the postinstall command will let Node automatically run it after installation.

Now you’ve learned how to fix the android.support.annotation package does not exist error in your Android application.

Thanks for reading! I hope this tutorial has been useful for you. 🙏

Description:

Ionic 4+ app fails to build after adding the firebasex package

Steps to Reproduce:
Step 1: Create a latest blank ionic project
Step 2: Added the firebasex package onto the Ionic 4+ project

       ionic cordova plugin add cordova-plugin-firebasex
       npm install @ionic-native/firebase-x

Step 3: Generate google-services.json from firebase project and add to the project folder
Step 4: Add android platform and build for android
Error received: Getting the following error when build for android
This project uses AndroidX dependencies, but the ‘android.useAndroidX’ property is not enabled. Set this property to
true in the gradle.properties file and retry.

Step 5: Modify platforms/android/gradle.properties as follows and rebuild
android.useAndroidX=true,
android.enableJetifier=true

    Same error as step 4 received and the flags get reset automatically to 'false' as follows
    org.gradle.daemon=true
    org.gradle.jvmargs=-Xmx2048m
    android.useAndroidX=false 
    android.enableJetifier=false
    cdvMinSdkVersion=22

Step 6: Add < preference name=»AndroidXEnabled» value=»true» /> in config.xml
ionic cordova prepare android
build for android

   Error received: Task :app:compileDebugJavaWithJavac FAILED

/Users/XXX/Development/app1/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:11: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;

Output:
/——————————————————————————————/
***** Output for Step4 error

Prepared android project successfully
Executing script found in plugin cordova-plugin-firebasex for hook «after_prepare»: plugins/cordova-plugin-firebasex/scripts/after_prepare.js
cordova-plugin-firebasex: Preparing Firebase on Android
No scripts found for hook «before_compile».
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/XXX/Library/Android/sdk (DEPRECATED)
Using Android SDK: /Users/XXX/Library/Android/sdk
Subproject Path: CordovaLib
Subproject Path: app
Gradle Distribution URL: https://services.gradle.org/distributions/gradle-6.5-all.zip

Task :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:mergeDebugResources’.

This project uses AndroidX dependencies, but the ‘android.useAndroidX’ property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.appcompat:appcompat:1.1.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.versionedparcelable:versionedparcelable:1.1.0, androidx.fragment:fragment:1.1.0, androidx.core:core:1.2.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.constraintlayout:constraintlayout-solver:1.1.3, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.activity:activity:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.collection:collection:1.1.0, androidx.viewpager:viewpager:1.0.0, androidx.cardview:cardview:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.arch.core:core-common:2.1.0, androidx.savedstate:savedstate:1.0.0, androidx.annotation:annotation:1.1.0, androidx.lifecycle:lifecycle-common:2.1.0, androidx.appcompat:appcompat-resources:1.1.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-viewmodel:2.1.0, androidx.constraintlayout:constraintlayout:1.1.3, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.browser:browser:1.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-v4:1.0.0, androidx.media:media:1.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.vectordrawable:vectordrawable-animated:1.1.0, androidx.lifecycle:lifecycle-runtime:2.1.0, androidx.vectordrawable:vectordrawable:1.1.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0

  • Try:
    Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output. Run with —scan to get full insights.

  • Get more help at https://help.gradle.org

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.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 959ms
9 actionable tasks: 2 executed, 7 up-to-date
Command failed with exit code 1: /Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/gradlew cdvBuildDebug -b /Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/build.gradle
Error: Command failed with exit code 1: /Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/gradlew cdvBuildDebug -b /Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/build.gradle
at makeError (/Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/cordova/node_modules/execa/lib/error.js:59:11)
at handlePromise (/Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/cordova/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[ERROR] An error occurred while running subprocess cordova.

    cordova build android --verbose exited with exit code 1.
    
    Re-running this command with the --verbose flag may provide more information.

ionic:utils-process onBeforeExit handler: ‘process.exit’ received +0ms
ionic:utils-process onBeforeExit handler: running 2 functions +0ms
ionic:utils-process processExit: exiting (exit code: 1) +37ms

/——————————————————————————————/


****Note: The following error occurs when < preference name=»AndroidXEnabled» value=»true» > is added in the config.xml


cordova-plugin-firebasex: Preparing Firebase on Android
No scripts found for hook «before_compile».
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/XXX/Library/Android/sdk (DEPRECATED)
Using Android SDK: /Users/XXX/Library/Android/sdk
Subproject Path: CordovaLib
Subproject Path: app
Gradle Distribution URL: https://services.gradle.org/distributions/gradle-6.5-all.zip

Task :app:compileDebugJavaWithJavac FAILED
/Users/XXX/Development/app1/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:11: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
^
/Users/XXX/Development/app1/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:137: error: cannot find symbol
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
^
symbol: class RequiresApi
location: class IonicWebViewEngine.ServerClient
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:compileDebugJavaWithJavac’.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output. Run with —scan to get full insights.

  • Get more help at https://help.gradle.org

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.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s
23 actionable tasks: 2 executed, 21 up-to-date
Command failed with exit code 1: /Users/XXX/Development/app1/platforms/android/gradlew cdvBuildDebug -b /Users/XXX/Development/app1/platforms/android/build.gradle
Error: Command failed with exit code 1: /Users/XXX/Development/app1/platforms/android/gradlew cdvBuildDebug -b /Users/XXX/Development/app1/platforms/android/build.gradle
at makeError (/Users/XXX/Development/app1/platforms/android/cordova/node_modules/execa/lib/error.js:59:11)
at handlePromise (/Users/XXX/Development/app1/platforms/android/cordova/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[ERROR] An error occurred while running subprocess cordova.

    cordova build android --verbose exited with exit code 1.
    
    Re-running this command with the --verbose flag may provide more information.

ionic:utils-process onBeforeExit handler: ‘process.exit’ received +0ms
ionic:utils-process onBeforeExit handler: running 2 functions +0ms
ionic:utils-process processExit: exiting (exit code: 1) +41ms
/——————————————————————————————/

My ionic info:
Ionic:
Ionic CLI : 6.11.0 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.3.3
@angular-devkit/build-angular : 0.1000.8
@angular-devkit/schematics : 10.0.8
@angular/cli : 10.0.8
@ionic/angular-toolkit : 2.3.3

Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 9.0.0, ios 6.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 8 other plugins)

Utility:
cordova-res (update available: 0.15.1) : 0.14.0
native-run (update available: 1.1.0) : 1.0.0

System:
Android SDK Tools : 26.1.1 (/Users/XXX/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v12.18.0 (/usr/local/bin/node)
npm : 6.14.8
OS : macOS Catalina
Xcode : Xcode 12.0 Build version 12A7209

I see a lot of posts online, are written half, not specific enough, or do not fit, I tried a lot of myself, finally got the solution.

prerequisite

Android studio 3.5.1 track of

the JDK 1.8 com. The Android. View the build: gradle: 3.5.1 track of migration to the
project androidx

step 1: check to see if build.gradle is configured

search build. If there is a keyword in gradle com. Android. Support: support - annotations
if not, you need to add configuration, the steps as shown in figure

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "com.android.support:support-annotations:28.0.0"
}

modifier error file

view the file with the error and modify the import package.

import android.support.annotation.IntDef;
import android.support.annotation.WorkerThread;

import androidx.annotation.IntDef;
import androidx.annotation.WorkerThread;

shortcut
Ctrl + Shift + R

import android. Support. The annotation.
with
import androidx. The annotation.

synchronization project Sync

Read More:

  • Maven compilation error: package does not exist jar package does not exist
  • Idea Maven project uses package to package and report error (package does not exist)
  • [error log] 27.1.0 series of errors Error:Failed to resolve: com.android.support :support-an notations:27.1.0
  • Android project error: could not resolve com.android.support .c onstraint:constraint-layout :2.0.2.
  • The MAC compiler Doris reported an error that thrift.annotation does not exist
  • android studio:Error inflating class android.support.v4.widget.SwipeRefreshLayout
  • Does the version of idea2020.1 import mybayis jar package or report an error? Error: (4,28) Java: package org.apache.ibatis.io does not exist
  • Android Studio sync build.gradle appears: Failed to resolve: com.android.support:appcompat problem
  • package R does not exist
  • [solved] not found android.support .v7. internal.app.WindowDecorActionbar
  • package xxx does not exist cannot find symbol
  • Idea error: (4, 28) Java: package com.alibaba.fastjson does not exist
  • [error record] as compilation error (Android support plugin version is too high | upgrade Android studio to the latest version)
  • Idea error: (4, 46) Java: package org.springframework.boot . autoconfigure does not exist problem solving
  • About Android studio error: (26,13) failed to resolve: com.android.support : appcompat-v7:27. + error
  • Failed to resolve: com.android.support:appcompat-v7:25.3.0
  • Error inflating class android.support.v7.widget.SearchView
  • [unity] Android package error java.lang.ClassNotFoundException Did not find class com.unity3d . player.MainActivity
  • [error record] kotlin code compilation error when Android studio compiles (process @ nonnull parameter when upgrading support library)
  • Failed to resolve: com.android.support:appcompat-v7:27.

  1. Revo Wisse



    Thread Starter

    This error has been posted on stackoverflow however mine is different.I updated to androidx, The project doesn’t show any error after sync and cleaning! but when i try to build it, i encounter this error in the build generated source.

    bellow is my app gradle

    1. apply plugin: ‘com.android.application’
    2. apply plugin: ‘realm-android’
    3.     buildToolsVersion ‘28.0.3’
    4.         applicationId ‘com.fundi.taxi.rider’
    5.         vectorDrawables.useSupportLibrary = true
    6.         testInstrumentationRunner «androidx.test.runner.AndroidJUnitRunner»
    7.             proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’
    8.     implementation  ‘pl.droidsonroids.gif:android-gif-drawable:1.2.17’
    9.     api fileTree(include: [‘*.jar’], dir: ‘libs’)
    10.     androidTestImplementation(‘androidx.test.espresso:espresso-core:3.1.0’, {
    11.         exclude group: ‘com.android.support’, module: ‘support-annotations’
    12.         exclude group: ‘com.google.code.findbugs’
    13.     api(‘com.mikepenz:fastadapter:2.0.0@aar’) {
    14.     implementation  ‘com.afollestad.material-dialogs:core:0.9.0.0’
    15.     implementation  ‘com.mikepenz:iconics-core:2.8.1@aar’
    16.     implementation  ‘com.mikepenz:fontawesome-typeface:4.6.0.2@aar’
    17.     implementation (‘cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2’) {
    18.         exclude module: ‘support-v4’
    19.     testImplementation ‘junit:junit:4.12’
    20.     annotationProcessor ‘com.jakewharton:butterknife-compiler:8.4.0’
    21.     implementation ‘androidx.cardview:cardview:1.0.0’
    22.     implementation ‘androidx.appcompat:appcompat:1.0.2’
    23.     implementation ‘androidx.recyclerview:recyclerview:1.0.0’
    24.     implementation ‘com.google.android.material:material:1.0.0’
    25.     implementation ‘androidx.legacy:legacy-support-v4:1.0.0’
    26.     implementation ‘androidx.vectordrawable:vectordrawable:1.0.1’
    27.     implementation ‘androidx.multidex:multidex:2.0.1’
    28.     implementation  ‘com.google.guava:guava:24.1-jre’
    29.     implementation  ‘com.dmitrymalkovich.android:material-design-dimens:1.4’
    30.     implementation  ‘com.ogaclejapan.smarttablayout:library:1.6.1@aar’
    31.     implementation  ‘com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar’
    32.     implementation  ‘com.jakewharton:butterknife:8.4.0’
    33.     implementation  ‘me.relex:circleindicator:1.2.2@aar’
    34.     implementation  ‘com.squareup.okhttp3:okhttp:3.10.0’
    35.     implementation  ‘com.squareup.retrofit2:retrofit:2.1.0’
    36.     implementation  ‘com.squareup.retrofit2:converter-gson:2.1.0’
    37.     implementation  ‘com.squareup.okhttp3:logging-interceptor:3.4.1’
    38.     implementation  ‘com.google.firebase:firebase-core:17.2.0’
    39.     implementation  ‘com.google.firebase:firebase-messaging:20.0.0’
    40.     implementation  ‘com.google.firebase:firebase-auth:19.0.0’
    41.     implementation  ‘com.mobsandgeeks:android-saripaar:2.0.3’
    42.     implementation  ‘com.google.android.libraries.places:places:2.0.0’
    43.     implementation  ‘com.google.android.gms:play-services:12.0.1’
    44.     implementation ‘com.google.android.gms:play-services-tasks:17.0.0’
    45.     implementation  ‘org.greenrobot:eventbus:3.1.0’
    46.     implementation  ‘com.makeramen:roundedimageview:2.2.1’
    47.     implementation  ‘com.squareup.picasso:picasso:2.5.2’
    48.     implementation  ‘com.amulyakhare:com.amulyakhare.textdrawable:1.0.1’
    49.     implementation  ‘com.github.siyamed:android-shape-imageview:0.9.3’
    50.     implementation  ‘de.hdodenhof:circleimageview:2.0.0’
    51.     implementation  ‘com.github.bumptech.glide:glide:3.7.0’
    52.     implementation  ‘com.mcxiaoke.volley:library:1.0.19’
    53.     implementation  ‘com.balysv:material-ripple:1.0.2’
    54.     implementation ‘androidx.constraintlayout:constraintlayout:1.1.3’
    55. apply plugin: ‘com.google.gms.google-services’
    1.         classpath ‘com.android.tools.build:gradle:3.4.2’
    2.         classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’
    3.         classpath ‘com.google.gms:google-services:4.3.1’
    4.         classpath ‘com.jakewharton:butterknife-gradle-plugin:10.1.0’
    5.         classpath ‘io.realm:realm-gradle-plugin:5.13.1’
    6.         // NOTE: Do not place your application dependencies here; they belong
    7.         // in the individual module build.gradle files
    8.             url «https://maven.google.com»
    9. task clean(type: Delete) {
    10.     delete rootProject.buildDir

    Attached Files:

    • Capture.PNG


    1. Download the Forums for Android™ app!

      Download

  2. Looks like you’re missing the annotation library in your dependencies in the build.gradle.

    1. implementation ‘androidx.annotation:annotation:1.0.2’

    Or could also be…

    1. implementation ‘androidx.annotation:annotation:1.1.0’
  3. Revo Wisse



    Thread Starter

    Thanks boss but it’s the same error!

Share This Page

Try with jetifier

npm install --save-dev jetifier
Or use yarn, but install it locally in your project, not globally

npx jetify
or
npx jetify -w=1 — to specify the number of parallel workers

npx react-native run-android

allprojects {
  repositories {
      bla bla bla...
  }
  subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "26.+"
            }
            if (details.requested.group == 'com.google.android.gms'
            && !details.requested.name.contains('multidex') && !details.requested.name.contains('play-services-stats')) {
                details.useVersion "12.+"
            }
            if (details.requested.group == 'com.google.android.gms'
            && !details.requested.name.contains('multidex') && details.requested.name.contains('play-services-stats')) {
                details.useVersion "+"
            }
         }
      }
   }
}

add subprojects in build.gradle (android)

dependencies {
     ...bla bla bla

    implementation "com.google.android.gms:play-services-gcm:12.+"
}

add implementation «com.google.android.gms:play-services-gcm:12.+» in build.gradle (android/app)

so you don’t need to migrate to Androidx

edit 1: code format

edit 2: missing a bracket

I actually had something very similar happen and running this worked

npx jetify

When I ran it through the CI pipeline it didn’t work and ended having to add

"scripts": {
 ...
    "postinstall": "jetify"
}

After npm runs install in the pipeline it then run jetify to convert to androidx and covers all the libraries that need to be converted.

try to use androidx

// build.gradle 
implementation "androidx.annotation:annotation:1.1.0"

// where use it
import androidx.annotation.Nullable;

UPDATE:

if other libraries error, maybe you can try jetifier,
I know it by this helpful issue.

the full reference is below, hope helpful : )

// android/build.gradle
ext {
    buildToolsVersion = "28.0.3"
    minSdkVersion = 24
    compileSdkVersion = 28
    targetSdkVersion = 28
    supportLibVersion = "1.0.0-beta01"
}

// app/build.gradle
dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "androidx.core:core:1.0.2"
    implementation "androidx.annotation:annotation:1.1.0"
    implementation "androidx.appcompat:appcompat:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:0.59.9"  // From node_modules
}

by the way, I meet this problem(AndroidX) for a few days, at last, solve it by update [email protected], use the latest android setting and the magic jetifier.

androidx error,butterknife android,butterknife androidx support,

I’ve recently upgrade a project which uses Butterknife Android v8.8.1 to make use of the new AndroidX libraries using Refactor—>Migrate to AndroidX option in Android Studio. I come across below androidx annotation error while migrating to AndroidX:

error: package android.support.annotation does not exist

implementation ‘com.jakewharton:butterknife:8.8.1’
annotationProcessor ‘com.jakewharton:butterknife-compiler:8.8.1’



It’s suggested updating ButterKnife to the newest version
Solved after update butterknife to latest—>

implementation ‘com.jakewharton:butterknife:10.1.0’
  annotationProcessor ‘com.jakewharton:butterknife-compiler:10.1.0’

Find Butter Knife latest snapshot: Butter Knife

Reference link for this issue:
Migrating to AndroidX —> AndroidX support in butterknife gradle plugin
https://github.com/JakeWharton/butterknife/issues/1280
https://github.com/JakeWharton/butterknife/issues/1300

build failed — Java Compilation androidx error Log:

org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ‘:app:compileDebugJavaWithJavac’.
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:145)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:115)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:62)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:49)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ‘:app:compileDebugJavaWithJavac’.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:143)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:115)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:62)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:49)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:app:compileDebugJavaWithJavac’.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
… 3 more
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:52)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:37)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:98)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:51)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:37)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringDecorator.execute(IncrementalResultStoringDecorator.java:41)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringDecorator.execute(IncrementalResultStoringDecorator.java:27)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalAnnotationProcessingCompiler.execute(IncrementalAnnotationProcessingCompiler.java:50)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalAnnotationProcessingCompiler.execute(IncrementalAnnotationProcessingCompiler.java:36)
at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:156)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:126)
at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:92)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
… 30 more

Popular Posts

  • To set the shape stroke color programmatically this example uses GradientDrawable method setStroke(int width, int color) which sets the …

  • In the xml-file you can set custom color with the attribute android:fillColor but to change the color of vector drawable in runtime/dynami…

  • Content 1) Android change color on drawables located in res folder 2) Android change textview drawables color programmatically 3) Source…

  • Change Shape Solid Color Programmatically in Android Kotlin. In the shape drawable xml-file you can set custom solid color with the attri…

  • Spinner Custom Item Layout <?xml version=»1.0″ encoding=»utf-8″?> <androidx.constraintlayout.widget.Constra…

  • I recently had the need to have a radio group where the selected item could be deselected by tapping it again. So, here I can be able to des…

  • https://stackoverflow.com/questions/25494740/is-there-a-shortcut-on-android-studio-to-convert-a-text-to-uppercase Using edit menu item: …

  • Issue detail: I am parsing the List using gson in kotlin with below syntax: val methods: ArrayList<DataPOJO> = Gson().fromJson(dat…

  • Found most of this crashes on Android 6.0 around 75% of the total crashes and 25% from Android 5.0. According to google Crashlytics  report…

  • Outline of Article Content 1. Error OverView: android webview showing net::ERR_CLEARTEXT_NOT_PERMITTED 2. Fix Cleartext Traffic Error in…

i am having an issue with the android.support.annotation package..
this is my main build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
        androidMapsUtilsVersion = "0.5+"

    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.0")
        classpath 'com.google.gms:google-services:4.0.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        // instead of 'implementation' here, you should insert 'implementation' in android/app/build.gradle'
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
           // Local Maven repo containing AARs with JSC library built for Android
          url "$rootDir/../node_modules/jsc-android/dist"
       }
    }
}



subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 28 
                buildToolsVersion "28.0.3"
            }
        }
    }
}


and this is my androidbuild.gradle:

buildscript {
    repositories {
        maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal 
    }
    dependencies {
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99]'
    }
}


apply plugin: "com.android.application"

import com.android.build.OutputFile

/**
 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
 * and bundleReleaseJsAndAssets).
 * These basically call `react-native bundle` with the correct arguments during the Android build
 * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
 * bundle directly from the development server. Below you can see all the possible configurations
 * and their defaults. If you decide to add a configuration block, make sure to add it before the
 * `apply from: "../../node_modules/react-native/react.gradle"` line.
 *
 * project.ext.react = [
 *   // the name of the generated asset file containing your JS bundle
 *   bundleAssetName: "index.android.bundle",
 *
 *   // the entry file for bundle generation
 *   entryFile: "index.android.js",
 *
 *   // whether to bundle JS and assets in debug mode
 *   bundleInDebug: false,
 *
 *   // whether to bundle JS and assets in release mode
 *   bundleInRelease: true,
 *
 *   // whether to bundle JS and assets in another build variant (if configured).
 *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
 *   // The configuration property can be in the following formats
 *   //         'bundleIn${productFlavor}${buildType}'
 *   //         'bundleIn${buildType}'
 *   // bundleInFreeDebug: true,
 *   // bundleInPaidRelease: true,
 *   // bundleInBeta: true,
 *
 *   // whether to disable dev mode in custom build variants (by default only disabled in release)
 *   // for example: to disable dev mode in the staging build type (if configured)
 *   devDisabledInStaging: true,
 *   // The configuration property can be in the following formats
 *   //         'devDisabledIn${productFlavor}${buildType}'
 *   //         'devDisabledIn${buildType}'
 *
 *   // the root of your project, i.e. where "package.json" lives
 *   root: "../../",
 *
 *   // where to put the JS bundle asset in debug mode
 *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
 *
 *   // where to put the JS bundle asset in release mode
 *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in debug mode
 *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in release mode
 *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
 *
 *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
 *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
 *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
 *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
 *   // for example, you might want to remove it from here.
 *   inputExcludes: ["android/**", "ios/**"],
 *
 *   // override which node gets called and with what additional arguments
 *   nodeExecutableAndArgs: ["node"],
 *
 *   // supply additional arguments to the packager
 *   extraPackagerArgs: []
 * ]
 */

project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"


/**
 * Set this to true to create two separate APKs instead of one:
 *   - An APK that only works on ARM devices
 *   - An APK that only works on x86 devices
 * The advantage is the size of the APK is reduced by about 4MB.
 * Upload all the APKs to the Play Store and people will download
 * the correct one based on the CPU architecture of their device.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion rootProject.ext.compileSdkVersion


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        multiDexEnabled true
        applicationId "com.course"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 35
        versionName "1.1.32"
    }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
    packagingOptions {
       pickFirst '**/libjsc.so'
       pickFirst '**/libc++_shared.so'
       pickFirst 'lib/x86/libc++_shared.so'
       pickFirst 'lib/x86_64/libjsc.so'
       pickFirst 'lib/arm64-v8a/libjsc.so'
       pickFirst 'lib/arm64-v8a/libc++_shared.so'
       pickFirst 'lib/x86_64/libc++_shared.so'
       pickFirst 'lib/armeabi-v7a/libc++_shared.so'
   }

}

dependencies {
    implementation project(':@react-native-community_cameraroll')
    implementation project(':react-native-reanimated')
    implementation project(':react-native-i18n')
    implementation project(':@react-native-community_async-storage')       
    implementation project(':react-native-gesture-handler')
    implementation project(':react-native-randombytes')
    implementation project(':react-native-sentry')
    implementation project(':react-native-appsee')
    implementation project(':react-native-image-resizer')
    implementation project(':react-native-onesignal')
    implementation project(':react-native-mixpanel')
    implementation project(':react-native-svg')
    implementation project(':react-native-image-picker')
    implementation project(':react-native-fs')
    implementation project(':react-native-wheel-pick')
    implementation project(':react-native-fast-image')
    implementation project(':react-native-vector-icons')
    // implementation project(':realm')
    implementation project(':react-native-camera')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-maps')
    implementation(project(':react-native-onesignal')){
      exclude group: 'com.google.android.gms'
    }

    // implementation(project(':react-native-maps')){
    //   exclude group: 'com.google.android.gms'
    // }
    implementation 'com.google.android.gms:play-services-base:16.0.0'
    implementation 'com.google.android.gms:play-services-basement:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.gms:play-services-tasks:16.0.0'
    implementation 'com.google.android.gms:play-services-maps:16.0.0'

    implementation 'org.webkit:android-jsc-cppruntime:+'
    // For even older gradle
    // compile 'org.webkit:android-jsc-cppruntime:+'
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'androidx.annotation:annotation:1.1.0'

}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}


configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
        force 'org.webkit:android-jsc:r241213'
    }
}

apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

I already added this piece of code to my gradle.properties:

...
android.useAndroidX=true
android.enableJetifier=true

this is the full error message that I get:

Gradle may disable incremental compilation as the following annotation
processors are not incremental: jetified-compiler-4.7.1.jar
(com.github.bumptech.glide:compiler:4.7.1). Consider setting the
experimental feature flag
android.enableSeparateAnnotationProcessing=true in the
gradle.properties file to run annotation processing in a separate task
and make compilation incremental. Note: [2] Wrote
GeneratedAppGlideModule with:
[com.bumptech.glide.integration.okhttp3.OkHttpLibraryGlideModule,
com.dylanvann.fastimage.FastImageOkHttpProgressGlideModule]
C:UsersOfirDesktopVegan
NationVeganNationnode_modulesreact-native-fast-imageandroidbuildgeneratedsourceaptdebugcomdylanvannfastimageGlideOptions.java:6:
error: package android.support.annotation does not exist import
android.support.annotation.CheckResult;
^ C:UsersOfirDesktopVegan NationVeganNationnode_modulesreact-native-fast-imageandroidbuildgeneratedsourceaptdebugcomdylanvannfastimageGlideOptions.java:7:
error: package android.support.annotation does not exist import
android.support.annotation.NonNull;
^ C:UsersOfirDesktopVegan NationVeganNationnode_modulesreact-native-fast-imageandroidbuildgeneratedsourceaptdebugcomdylanvannfastimageGlideRequest.java:8:
error: package android.support.annotation does not exist import
android.support.annotation.CheckResult;
^ C:UsersOfirDesktopVegan NationVeganNationnode_modulesreact-native-fast-imageandroidbuildgeneratedsourceaptdebugcomdylanvannfastimageGlideRequest.java:9:
error: package android.support.annotation does not exist import
android.support.annotation.NonNull;
^ C:UsersOfirDesktopVegan NationVeganNationnode_modulesreact-native-fast-imageandroidbuildgeneratedsourceaptdebugcomdylanvannfastimageGlideRequests.java:7:
error: package android.support.annotation does not exist import
android.support.annotation.CheckResult;
^ C:UsersOfirDesktopVegan NationVeganNationnode_modulesreact-native-fast-imageandroidbuildgeneratedsourceaptdebugcomdylanvannfastimageGlideRequests.java:8:
error: package android.support.annotation does not exist import
android.support.annotation.NonNull;

Thank you!

Понравилась статья? Поделить с друзьями:
  • Error permission denied apply2files usr local lib docker cli plugins
  • Error overloaded operator must be a unary or binary operator has 3 parameters
  • Error perl execution failed
  • Error overloaded function with no contextual type information
  • Error performing query перевод