hegaojian / JetpackMvvm

:chicken::basketball:一个Jetpack结合MVVM的快速开发框架,基于MVVM模式集成谷歌官方推荐的JetPack组件库:LiveData、ViewModel、Lifecycle、Navigation组件 使用Kotlin语言,添加大量拓展函数,简化代码 加入Retrofit网络请求,协程,帮你简化各种操作,让你快速开发项目
https://github.com/hegaojian/JetpackMvvm
Apache License 2.0
3.13k stars 610 forks source link

5月16号的编译怎么过不了了 #63

Closed 18810951092 closed 3 years ago

longxuewei commented 3 years ago

Jcenter跑路了?

hegaojian commented 3 years ago

我现在迁移到JitPack仓库了

lh414035210 commented 3 years ago

大神,编译不过呀。。

hegaojian commented 3 years ago

@lh414035210 贴一下错误信息

lh414035210 commented 3 years ago

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:

hegaojian commented 3 years ago

maven { url 'https://jitpack.io' } 这个你加了吗

lh414035210 commented 3 years ago

加了

hegaojian commented 3 years ago

你的 as 版本是多少

lh414035210 commented 3 years ago

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

hegaojian commented 3 years ago

刚更新了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'
}

远程库拉下来了,能运行,并没有什么异常

lh414035210 commented 3 years ago

感谢作者, 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' } //这里没加,才导致那个问题 } }

hegaojian commented 3 years ago

我的锅,文档没有写清楚