Android Studio 我如何修复这个关于插件和sdk版本的错误

sd2nnvve  于 2023-10-23  发布在  Android
关注(0)|答案(1)|浏览(119)

当我尝试运行android应用程序时会发生这种情况(https://i.stack.imgur.com/4y8Gy.png)这是build.gradle代码

apply plugin: 'com.android.library'
apply plugin: 'maven-publish'



ext {
    bintrayRepo = 'maven'
    bintrayName = 'material-hijri-calendarview'

    publishedGroupId = 'com.github.eltohamy'
    libraryName = 'material-hijri-calendarview'
    artifact = 'material-hijri-calendarview'

    libraryDescription = 'A Material design back port of Android\'s Hijri CalendarView. The goal is to have a Material look and feel, rather than 100% parity with the platform\'s implementation.'

    siteUrl = 'https://github.com/eltohamy/material-hijri-calendarview'
    gitUrl = 'hhttps://github.com/eltohamy/material-hijri-calendarview.git'

    libraryVersion = '1.1.2'

    developerId = 'eltohamy'
    developerName = 'El-Tohamy Allam'
    developerEmail = '[email protected]'

    licenseName = 'The Apache Software License, Version 2.0'
    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    allLicenses = ["Apache-2.0"]
}
android {
    compileSdkVersion 30
    buildToolsVersion "29.0.3"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 31
    }
}

dependencies {
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation group: 'com.github.msarhan', name: 'ummalqura-calendar', version: '1.1.9'

    testImplementation 'junit:junit:4.13'

}
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'

尝试删除maven插件,因为这是互联网上最推荐的答案,但仍然不起作用,我使用的sdkVersion是34

t8e9dugd

t8e9dugd1#

尝试用现有代码更改下面的代码

apply plugin: 'com.android.library'


ext {

    publishedGroupId = 'com.github.eltohamy'
    libraryName = 'material-hijri-calendarview'
    artifact = 'material-hijri-calendarview'

    libraryDescription = 'A Material design back port of Android\'s Hijri CalendarView. The goal is to have a Material look and feel, rather than 100% parity with the platform\'s implementation.'

    siteUrl = 'https://github.com/eltohamy/material-hijri-calendarview'
    gitUrl = 'hhttps://github.com/eltohamy/material-hijri-calendarview.git'

    libraryVersion = '1.1.2'

    developerId = 'eltohamy'
    developerName = 'El-Tohamy Allam'
    developerEmail = '[email protected]'

    licenseName = 'The Apache Software License, Version 2.0'
    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    allLicenses = ["Apache-2.0"]
}
android {
    compileSdkVersion 31
    buildToolsVersion "29.0.3"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 31
    }
}

dependencies {
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation group: 'com.github.msarhan', name: 'ummalqura-calendar', version: '1.1.9'

    testImplementation 'junit:junit:4.13'

}

在这里,我已经删除了bintry细节和bottoms中与bintry库相关的两行
因为它解决了将Gradle更新到最新Android版本的问题
我有同样的问题,所以删除后,它为我工作

相关问题