ошибка: пакет com.nguyenhoanglam.imagepicker.activity не существует - PullRequest
8 голосов
/ 01 августа 2020

Ошибка компилятора отсутствует. Я получаю эту ошибку во время выполнения.

error: package com.nguyenhoanglam.imagepicker.activity does not exist

Я использую много библиотек в своем проекте. Ссылка на библиотеку:

https://github.com/nguyenhoanglam/ImagePicker

  • Я добавил библиотеку скольжения
  • Изменены compileSdkVersion и targetSdkVersion с 28 на 29.
  • Проект перенесен на AndroidX

Перед изменением проблем не было.

Project Gradle:

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

buildscript {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' }
        maven { url "https://jitpack.io"}

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.4'

        //classpath 'com.google.gms:google-services:1.3.0-beta1'
        classpath 'com.google.gms:google-services:4.3.3'



        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io"}

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

App Gradle:

apply plugin: 'com.android.application'

buildscript {
    repositories {
        maven { url 'https://plugins.gradle.org/m2/'}
        maven { url "https://jitpack.io" }
        google()
        jcenter()

    }
    dependencies {
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.4, 0.99.99]'
    }
}


apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'


android {
    compileSdkVersion 29
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "x.y.z"

        manifestPlaceholders = [onesignal_app_id: "XX",
                                // Project number pulled from dashboard, local value is ignored.
                                onesignal_google_project_number: "YY"]

        minSdkVersion 16
        targetSdkVersion 29
        versionCode 35
        versionName "3.10.0"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.intuit.sdp:sdp-android:1.0.3'
    implementation 'com.jaredrummler:material-spinner:1.1.0'
    implementation 'com.github.nguyenhoanglam:ImagePicker:1.4.3'
    implementation 'com.google.android.gms:play-services-ads:19.3.0'
    implementation 'com.google.android.gms:play-services-analytics:17.0.0'
    implementation 'com.github.hotchemi:android-rate:1.0.1'
    implementation 'com.karumi:dexter:5.0.0'
    //4.1.0
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-core:17.4.4'
    implementation 'com.google.firebase:firebase-database:19.3.1'
    implementation 'com.google.firebase:firebase-messaging:20.2.4'
    testImplementation 'junit:junit:4.12'
    implementation 'com.onesignal:OneSignal:[3.11.2, 3.99.99]'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
}



apply plugin: 'com.google.gms.google-services'

Как я могу решить свою проблему?

Ответы [ 2 ]

5 голосов
/ 08 августа 2020

Библиотека изменена.

На самом деле я использую Java, а не Kotlin.

Когда я смотрел библиотеку, я увидел, что есть другая эквивалентная библиотека для Java.

https://github.com/esafirm/android-image-picker

Теперь эта библиотека работает без проблем. Не знаю, почему не работает первая библиотека.

2 голосов
/ 11 августа 2020

Вы можете использовать Android -Image-Cropper , что мне кажется очень осуществимым и удобным.

...