ArthurHub / Android-Image-Cropper

Image Cropping Library for Android, optimized for Camera / Gallery.
Apache License 2.0
6.39k stars 1.37k forks source link

bug when upgrading to version 2.8.0 #650

Open EdwinaVargas opened 5 years ago

EdwinaVargas commented 5 years ago

this is a error:

Android resource linking failed Output: /home/dev/git/offrie-android/Deals/app/build/intermediates/incremental/mergeDevelopDebugResources/merged.dir/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found. /home/dev/git/offrie-android/Deals/app/build/intermediates/incremental/mergeDevelopDebugResources/merged.dir/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found. /home/dev/git/offrie-android/Deals/app/build/intermediates/incremental/mergeDevelopDebugResources/merged.dir/values/values.xml:672: error: resource android:attr/fontVariationSettings not found. /home/dev/git/offrie-android/Deals/app/build/intermediates/incremental/mergeDevelopDebugResources/merged.dir/values/values.xml:672: error: resource android:attr/ttcIndex not found. error: failed linking references.

Command: /home/edwinvargas/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/6b6e14aacb166ecf82e7269b6699b50d/aapt2-3.2.1-4818971-linux/aapt2 link -I\ /home/edwinvargas/Android/Sdk/platforms/android-27/android.jar\ --manifest\ /home/dev/git/offrie-android/Deals/app/build/intermediates/merged_manifests/developDebug/processDevelopDebugManifest/merged/AndroidManifest.xml\ -o\ /home/dev/git/offrie-android/Deals/app/build/intermediates/processedres/developDebug/processDevelopDebugResources/out/resources-developDebug.ap\ -R\ @/home/dev/git/offrie-android/Deals/app/build/intermediates/incremental/processDevelopDebugResources/resources-list-for-resources-developDebug.ap_.txt\ --auto-add-overlay\ --java\ /home/dev/git/offrie-android/Deals/app/build/generated/not_namespaced_r_class_sources/developDebug/processDevelopDebugResources/r\ --proguard-main-dex\ /home/dev/git/offrie-android/Deals/app/build/intermediates/legacy_multidex_aapt_derived_proguard_rules/developDebug/processDevelopDebugResources/manifest_keep.txt\ --custom-package\ co.transportsystems.offrie\ -0\ apk\ --output-text-symbols\ /home/dev/git/offrie-android/Deals/app/build/intermediates/symbols/develop/debug/R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #0

brimanning commented 5 years ago

I got a similar error when using the CropImageActivity and it wasn't able to find the layout resource.

sanjeevkarat commented 5 years ago

What version of android support libraries are you using?

brimanning commented 5 years ago

Here are the relevant AndroidX declarations:

    implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.browser:browser:1.0.0'
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.exifinterface:exifinterface:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
    implementation 'androidx.emoji:emoji:1.0.0'
    implementation 'androidx.emoji:emoji-appcompat:1.0.0'
    implementation 'androidx.lifecycle:lifecycle-runtime:2.0.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
    implementation 'androidx.room:room-runtime:2.1.0-alpha04'
    implementation 'androidx.paging:paging-runtime:2.1.0'

Hopefully that helps, thanks.

sanjeevkarat commented 5 years ago

What is your compile SDK version?

brimanning commented 5 years ago

28.

sanjeevkarat commented 5 years ago

Not sure if it's gonna help but downgrade gradle to 3.1.4 and check. Remove the

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="27"/>

from manifest.xml

Delete the build folder. Clean rebuild.

Swjzhao commented 5 years ago

2.8.0 adds Androidx, try adding support https://developer.android.com/jetpack/androidx/migrate or just stick with 2.7.0 unless u really need 2.8.0 features

brimanning commented 5 years ago

I haven't gotten a chance to try downgrading gradle, but the issue happens when using AndroidX and 2.8.0. Moving back to 2.7.0 with AndroidX works.

unludo commented 5 years ago

Just for info, migrating to androidX is automated from the IDE and is the way forward now as it comes in replacement of the support libraries that will disappear in the next version of android.