Ситуация:
- Создать простейший проект
- Добавить в модуль проекта как Файл -> Новый -> Новый модуль "Модуль телефона и планшета"
- Добавить зависимость от модуля
И получить ошибки:
Невозможно разрешить зависимость для ': app @ debug / compileClasspath': Не удалось разрешить проект: testmodule.
Невозможно разрешить зависимость для ': app @ debugAndroidTest / compileClasspath': Не удалось разрешить проект: testmodule.
Невозможно разрешить зависимость для ': app @debugUnitTest / compileClasspath ': не удалось разрешить проект: testmodule.
Невозможно разрешить зависимость для': app @ release / compileClasspath ': не удалось разрешить проект: testmodule.
Невозможно разрешить зависимость для': app @ releaseUnitTest / compileClasspath': не удалось разрешить проект: testmodule.
Ниже приведены файлы проекта:
Проект:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Модуль: приложение
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.pawga.test00"
minSdkVersion 14
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-alpha3'
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(path: ':testmodule')
}
Модуль: тестовый модуль
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.pawga.testmodule"
minSdkVersion 14
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-alpha3'
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'
}
gradle-wrapper.properties
#Mon Jun 25 22:51:52 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
settings.gradle
include ':app', ':testmodule'
Примечание. Если тип модуля - «Библиотека Android» (точка «два» выше), то таких ошибок нет.
Для такого простого проекта, где все поПо умолчанию не должно быть таких ошибок.Что не так?