我是安卓新手.在添加Dhaval2404图像拾取器依赖项:implementation 'com.github.dhaval2404:imagepicker-support:1.7.1'时,我在同步项目时发现异常错误.

Build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath 'com.google.gms:google-services:4.3.13'
        // 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
}

应用程序:Gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 33
    buildToolsVersion "33.0.0"
    defaultConfig {
        applicationId "com.project.app"
        minSdkVersion 17
        targetSdkVersion 33
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.github.dhaval2404:imagepicker-support:1.7.1'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.firebaseui:firebase-ui-database:3.2.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
}
apply plugin: 'com.google.gms.google-services'

先谢谢你.

推荐答案

您不需要添加maven存储库.在build.gradle中添加maven存储库:

 allprojects {
   repositories {
        maven { url "https://jitpack.io" }
   }
}

Android相关问答推荐

如何将子零部件的大小调整为可以调整大小的父组件大小?

如何禁用Android 34+版的TileService,但保留以前的版本?

安卓Gradle看不到dagger 柄

如何使可拖动内容停留在可组合框的边界内

react 本机生成失败,出现异常.错误:无法确定';<;宏/>;的类型

Android从已连接的设备获得GATT

找不到com.android.tools.build:gradle:8.0

如何使用其他组件的位置来定位自定义弹出窗口

为什么 Android Studio 中的 theme.xml 目录没有任何原色

将 React Native 应用程序背景带到前台

appcompat 依赖从何而来?

如何在 Jetpack Compose 中的特定位置绘制图像

设置背景图片组成Column

compose 导航参数字符串包含花括号?

在 Jetpack Compose 中使用 .observeAsState() 时,如何在更改 MutableLiveData 的值后开始执行一段代码?

协程中的 Job.Cancel 与 Scope.Cancel 有什么区别?

如何在行/列/卡片 compose 中添加左边框

如何修复 api 调用在浏览器中工作但在 android studio 中为 403

Android YouTube SDK - 视频无法在某些 Android 设备中播放

使用支持 (v21) 工具栏创建首选项屏幕