Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android gradle //noinspection GradleCompatible

What does it mean in android gradle.

adding //noinspection GradleCompatible has resolve the conflict issue with dependencies.

like image 879
Amir Raza Avatar asked Jun 06 '18 06:06

Amir Raza


2 Answers

  • You can get this warning for your gradle configuration for example if your app code is mixing library versions.
  • A common example of this happening is with the Android support libraries.
  • Also if additional 3rd party libraries included in your project are using different versions, that can also present warnings.
  • Android Studio will show you details of the error message, before you suppress it with 'GradleCompatible' by hovering over the red warning line in the IDE (see attached screenshot).
  • '//noinspection GradleCompatible' just suppresses the warning. Basically do not inspect issues with Gradle compatibility, as relates to the next line of the config.

Example of GradleCompatible warning in Android Studio IDE

like image 189
WildStyle Avatar answered Oct 17 '22 05:10

WildStyle


I had the same problem and finally I have added this line by pressing alt+enter, but before that check if the app compat library version is latest version that there is available for your app's target sdk version.

If that is okay and you are still getting the problem then do this by pressing alt+enter key (in ubuntu and windows) and (in mac os (os x) use command +shift +enter) add noinspection GradleCompatible this will help!

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'me.dm7.barcodescanner:zxing:1.9'
    implementation 'com.android.support:support-media-compat:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    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'
}
like image 35
Imran Avatar answered Oct 17 '22 06:10

Imran