18

my gradle code

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "gt.otomat7"
        minSdkVersion 22
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
    androidTestImplementation "com.android.support:support-annotations:27.1.1"
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation project(':libraries:tess-two')
}

But ı got an error about annotation does not exist I am using tesseract library and my android studio version

Android Studio 3.1.4
Build #AI-173.4907809, built on July 24, 2018
JRE: 1.8.0_152-release-1024-b02 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

thank you for your helps

Saveen
  • 4,120
  • 14
  • 38
  • 41
asuscu
  • 225
  • 1
  • 3
  • 13

5 Answers5

9

The following answer solved my problem: https://stackoverflow.com/a/56674446/643156

yarn add --dev jetifier
yarn run jetify
refik
  • 458
  • 6
  • 11
9

Please change from:

android.support.annotation

to:

androidx.annotation
Nimantha
  • 6,405
  • 6
  • 28
  • 69
ChongFei Li
  • 141
  • 2
  • 3
4

Because you are using SDK version 28, change the following version from

implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
androidTestImplementation "com.android.support:support-annotations:27.1.1"

to

implementation 'com.android.support:appcompat-v7:28.0.0'
androidTestImplementation "com.android.support:support-annotations:28.0.0"
Bill DeRose
  • 2,330
  • 3
  • 25
  • 36
Yusuf Adefolahan
  • 312
  • 2
  • 11
3

Go to your IonicWebViewEngine.java file and change from:

import android.support.annotation.RequiresApi;

to:

import androidx.annotation.RequiresApi;
Dharman
  • 30,962
  • 25
  • 85
  • 135
Amoo Faruk
  • 63
  • 5
1

Go to your IonicWebViewEngine.java file and change from:

android.support.annotation

to:

androidx.annotation
Nimantha
  • 6,405
  • 6
  • 28
  • 69
Mouad Chaouki
  • 538
  • 4
  • 6