Closed 18810951092 closed 3 years ago
我现在迁移到JitPack仓库了
大神,编译不过呀。。
@lh414035210 贴一下错误信息
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
Could not resolve all files for configuration ':app:debugCompileClasspath'. Could not find com.github.hegaojian:JetpackMvvm:1.2.2. Required by: project :app
Possible solution:
maven { url 'https://jitpack.io' } 这个你加了吗
加了
你的 as 版本是多少
as: 4.2.1 classpath "com.android.tools.build:gradle:4.2.1" distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
刚更新了as到4.2.1,新建了一个项目,跟你的环境保持了一致
as: 4.2.1
classpath "com.android.tools.build:gradle:4.2.1"
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-bin.zip
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.10"
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.testgithub"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
dataBinding = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.github.hegaojian:JetpackMvvm:1.2.2'
}
远程库拉下来了,能运行,并没有什么异常
感谢作者, repositories { google() mavenCentral() maven { url 'https://jitpack.io' } } //我只在这里加了
allprojects { repositories { google() mavenCentral() jcenter() // Warning: this repository is going to shut down soon maven { url 'https://jitpack.io' } //这里没加,才导致那个问题 } }
我的锅,文档没有写清楚
Jcenter跑路了?