我是 Android 开发新手。我从 Android Studio 和
ns build android
: 都收到此错误
Build file 'C:\Progetti\APP\src\app-mobile\platforms\android\app\build.gradle' line: 577
A problem occurred configuring project ':app'.
Could not find com.tapadoo.android:alerter:6.1.0.
Required by:
project :app
我使用来自 https://github.com/Tapadoo/Alerter
的建议配置更新了我的 build.gradle 文件repositories {
// used for local *.AAR files
pluginDependencies = nativescriptDependencies.collect {
"$rootDir/${it.directory}/$PLATFORMS_ANDROID"
}
// some plugins may have their android dependencies in a /libs subdirectory
pluginDependencies.addAll(nativescriptDependencies.collect {
"$rootDir/${it.directory}/$PLATFORMS_ANDROID/libs"
})
if (!externalRuntimeExists) {
pluginDependencies.add("libs/runtime-libs")
}
def appResourcesPath = getAppResourcesPath()
def localAppResourcesLibraries = "$appResourcesPath/Android/libs"
pluginDependencies.add(localAppResourcesLibraries)
if (pluginDependencies.size() > 0) {
flatDir {
dirs pluginDependencies
}
}
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
.
.
.
implementation "androidx.multidex:multidex:$androidXMultidexVersion"
implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion"
debugImplementation "com.google.android.material:material:$androidXMaterialVersion"
implementation "androidx.exifinterface:exifinterface:$androidXExifInterfaceVersion"
implementation "androidx.viewpager2:viewpager2:$androidXViewPagerVersion"
implementation "androidx.fragment:fragment:$androidXFragmentVersion"
implementation "androidx.transition:transition:$androidXTransitionVersion"
implementation "com.tapadoo.android:alerter:6.1.0"
def useV8Symbols = false
def appPackageJsonFile = file("${getAppPath()}/$PACKAGE_JSON")
if (appPackageJsonFile.exists()) {
def appPackageJson = new JsonSlurper().parseText(appPackageJsonFile.text)
useV8Symbols = appPackageJson.android && appPackageJson.android.useV8Symbols
}
if (!useV8Symbols) {
// check whether any of the dependencies require v8 symbols
useV8Symbols = nativescriptDependencies.any {
def packageJsonFile = file("$rootDir/${it.directory}/$PACKAGE_JSON")
def packageJson = new JsonSlurper().parseText(packageJsonFile.text)
return packageJson.nativescript && packageJson.nativescript.useV8Symbols
}
}
所有这些配置最初都是由
ns build android
生成的,当我运行这样的命令时,我得到了同样的错误。
我错过了什么?预先感谢,非常感谢任何帮助。
的建议配置更新了我的 build.gradle 文件
你有:
implementation "com.tapadoo.android:alerter:6.1.0"
他们有:
implementation 'com.github.tapadoo:alerter:$current-version'
您有
com.tapadoo.android
作为工件组。 这个库多年前就使用过它。他们当前的指令将 com.github.tapadoo
作为工件组,这不是您所拥有的。并且,对于 com.github.tapadoo
,从今天起$current-version
是 7.2.4
。
所以,你应该使用:
implementation "com.github.tapadoo:alerter:7.2.4"