Search code examples
androidmesibo

Android Studio "unused import" message when putting SDK inside build.gradle


I'm trying to insert an SDK called Mesibo for communication, and in my project it instantly greys out when I try to import: import com.mesibo.api.mesibo; with the message cannot resolve symbol 'mesibo' and unused import around it

This is the build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.richard.myapplication"
        minSdkVersion 15
        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 'com.mesibo.api:mesibo:1.0.5'
    implementation 'com.mesibo.api:calls:1.0.3'
    implementation 'com.mesibo.api:ui:1.0.4'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
    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'
}

import com.mesibo.api.mesibo;

I'm following their documentation, and the import stops gradle from syncing with the project for some reason. I'm very new to Android Studio and this is my first time attempting to place an SDK + API in.


Solution

  • This goes in your Java/Kotlin code, not in Gradle

    import com.mesibo.api.mesibo;
    

    So remove it from there, and then compile the code, then add it to the other source files you need this class.

    And I think that their documentation is very poor... should be

    import com.mesibo.api.Mesibo;
    

    https://github.com/mesibo/samples/tree/master/android/MesiboSample/app/src/main/java/com/mesibo/firstsample