Не используйте явное указание имени lib - PullRequest
0 голосов
/ 03 июля 2019

В моем основном приложении я использую привязку модуля:

app/build.gradle:

def AAVersion = '4.6.0'

dependencies {
    annotationProcessor "org.androidannotations:androidannotations:$AAVersion"

    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.code.gson:gson:2.8.5'

    implementation "org.androidannotations:androidannotations-api:$AAVersion"

  implementation project(':binding')

}

В модуле привязка в папке libs У меня есть lib "libs/androidbinding.jar"

здесь binding / app / build.gradle:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support:appcompat-v7:28.0.0'

    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 gueei.binding.observables.StringObservable;

ошибка:

Cannot resolve symbol 'StringObservable'

Чтобы это исправить, я должен использовать это в binding / build.gradle:

compile files('libs/androidbinding.jar')

Зачем мне это нужно?Можно ли исправить проблему без этой строки?

compile files('libs/androidbinding.jar')
...