Ad
Migrating AndroidX Run Error Android.support.annotation Does Not Exist
I just have migrated my project to AndroidX. Sync and build phase are ok, but when I try to run the compiler show me this error:
error: package android.support.annotation does not exist
This error raises on a builded file
// Generated code from Butter Knife. Do not modify!
package com.xdatanet.cda.Adapters;
import android.support.annotation.CallSuper; //<-- Doesn't exists
import android.support.annotation.UiThread; //<-- Doesn't exists
import android.view.View;
import android.widget.ImageView;
import butterknife.Unbinder;
import butterknife.internal.Utils;
import com.xdatanet.cda.CustomView.CDATextView;
import com.xdatanet.cda.R;
import java.lang.IllegalStateException;
import java.lang.Override;
public class CommunicationAdapter$CommunicationViewHolder_ViewBinding implements Unbinder {
private CommunicationAdapter.CommunicationViewHolder target;
@UiThread //<-- First error
public CommunicationAdapter$CommunicationViewHolder_ViewBinding(CommunicationAdapter.CommunicationViewHolder target,
View source) {
// Some generated code
}
@Override
@CallSuper //<-- Second error
public void unbind() {
// Some generated code
}
}
Gradle properties
android.enableJetifier=true
android.useAndroidX=true
Butterknife implementation into gradle
implementation "com.jakewharton:butterknife:8.8.1"
annotationProcessor "com.jakewharton:butterknife-compiler:8.8.1"
The IDE says Files under the "build" folder are generated and should not be edited.
- Android Studio 3.2.1
- Min Sdk 19, Max Sdk 28
- Gradle version 3.2.1
It seems to be an error with butterknife but I don't know why.
Ad
Answer
I would suggest updating ButterKnife to the newest version.
I haven't migrated my projects to AndroidX yet, but from the commit history on the ButterKnife github page, it would seem like that the newest 9.0.x versions support AndroidX.
Ad
source: stackoverflow.com
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
Ad