Programming

오류 : 리소스 android : attr / fontVariationSettings를 찾을 수 없습니다

procodes 2020. 7. 28. 21:52
반응형

오류 : 리소스 android : attr / fontVariationSettings를 찾을 수 없습니다


경고 : android.dexOptions.incremental이 속성은 더 이상 사용되지 않으며 빌드 프로세스에는 영향을 미치지 않습니다. /home/midhilaj/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/be3106efb0df111fe5a3f7b356dd070b/res/values/values.xml 오류 : (246, 5) 오류 : 리소스 android : attr / fontVariation 설정을 찾을 수 없습니다. /project/bkup/7_march_2018/hyshoper/milla/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml 오류 : (246, 5) 오류 : resource android : attr / ttcIndex를 찾을 수 없습니다. 오류 : (269) android : attr / ttcIndex 리소스를 찾을 수 없습니다. 오류 : (269) android : attr / fontVariationSettings 리소스를 찾을 수 없습니다. 오류 : java.util.concurrent.ExecutionException : java.util.concurrent.ExecutionException : com.android.tools.aapt2.Aapt2Exception : AAPT2 오류 : 세부 사항은 로그 확인 오류 : 링크 참조에 실패했습니다. 오류 : java.util.concurrent.ExecutionException : com.android.tools.

aapt를 실행하지 못했습니다. 정보 : 9 오류 정보 : 2 초에 빌드 실패 정보 : 1 경고 정보 : 콘솔의 전체 출력 참조

이 문제를 해결하는 방법? 내 의존성

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })


    compile 'de.hdodenhof:circleimageview:2.2.0'



    compile('com.alibaba.android:ultraviewpager:1.0.6.1@aar') {
        transitive = true
    }
    compile('org.apache.httpcomponents:httpmime:4.3.6') {
        exclude module: 'httpclient'
    }
    compile 'com.synnapps:carouselview:0.1.4'
    compile 'com.sun.mail:android-mail:1.5.5'
    compile 'com.sun.mail:android-activation:1.5.5'
    implementation 'com.muddzdev:styleabletoast:2.0.2'
    compile 'javax.annotation:javax.annotation-api:1.2'




    compile 'me.grantland:autofittextview:0.2.+'
    // base library
     //slider
    compile 'com.ss.bannerslider:bannerslider:1.8.0'
    //noinspection GradleCompatible
    compile 'jp.wasabeef:recyclerview-animators:2.2.7'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.github.satyan:sugar:1.4'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:percent:26.1.0'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.github.satyan:sugar:1.4'
    compile 'jp.wasabeef:recyclerview-animators:2.2.6'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    compile 'com.afollestad.material-dialogs:core:0.9.4.2'
    compile 'com.google.android.gms:play-services:9.8.0'
    compile 'com.google.android.gms:play-services-auth:9.8.0'
    compile 'com.google.android.gms:play-services-location:9.8.0'
    compile 'com.google.firebase:firebase-core:9.8.0'
    compile 'com.google.firebase:firebase-auth:9.8.0'
    compile 'com.google.firebase:firebase-database:9.8.0'
    compile 'com.google.firebase:firebase-config:9.8.0'
    compile 'com.google.firebase:firebase-crash:9.8.0'
    compile 'com.google.firebase:firebase-invites:9.8.0'
    compile 'com.google.firebase:firebase-storage:9.8.0'
    compile 'cn.pedant.sweetalert:library:1.3'
    compile 'at.blogc:expandabletextview:1.0.3'
    compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.+'
    compile 'com.android.support:appcompat-v7:26.1.0'

    implementation 'com.github.bumptech.glide:glide:4.6.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    implementation 'com.android.support:design:26.1.0'

}

compileSdkVersion을 다음과 같이 변경하십시오.

compileSdkVersion 28

fontVariationSettings는 API 레벨 28에 추가되었습니다. Api doc here


버전 28으로 변경된 안드로이드 지원 라이브러리와 호환되지 않기 때문에 발생합니다. 빌드가 낮은 지원 라이브러리를 사용하도록하여 문제를 해결했습니다. // 빌드 gradle처럼

configurations.all {
        resolutionStrategy {
                force 'com.android.support:support-v4:27.1.0'
    }
} 

이 변경 후 즉시 프로젝트가 성공적으로 빌드되었습니다. 이것이 당신에게도 도움이되기를 바랍니다. 이 때문에 개발 하루를 잃었습니다!.


For those that must keep compileSdkVersion 27 and are unable to upgrade to androidx yet, you must not upgrade to (or over) the versions of dependencies in the following links. These links are where the breaking change was introduced. You must find an earlier version that doesn't use androidx.

https://firebase.google.com/support/release-notes/android#update_-_june_17_2019

https://developers.google.com/android/guides/releases#june_17_2019

For instance, the following are compatible with compileSdkVersion 27:

dependencies {
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.firebase:firebase-messaging:18.0.0'
}

The following will break with compileSdkVersion 27 and are only compatible with compileSdkVersion 28:

dependencies {
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.android.gms:play-services-location:17.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.firebase:firebase-messaging:19.0.0'
}

If you are updating to v28

change the compileSdkVersion to compileSdkVersion 28


For native Android apps (not Cordova) solution for me is:

Was:

implementation 'com.android.support:support-v13:+'

Now:

implementation 'com.android.support:support-v13:27.1.1'

Another fix for Ionic 3 devs is to create build-extras.gradle inside platforms/android and put following

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }
}

Note that build-extras.gradle is not the same as build.gradle


I solve this problem with the line below:

cordova plugin add cordova-android-support-gradle-release --save

After that the compile was succesful.


@All the issue is because of the latest major breaking changes in the google play service and firebase June 17, 2019 release.

If you are on Ionic or Cordova project. Please go through all the plugins where it has dependency google play service and firebase service with + mark

Example:

In my firebase cordova integration I had com.google.firebase:firebase-core:+ com.google.firebase:firebase-messaging:+ So the plus always downloading the latest release which was causing error. Change + with version number as per the March 15, 2019 release https://developers.google.com/android/guides/releases

Make sure to replace + symbols with actual version in build.gradle file of cordova library


Usually it's because of sdk versions and/or dependencies.

For Cordova developers, put your dependencies settings in "project.properties" file under CORDOVA_PROJECT_ROOT/platforms/android/ folder, like this:

target=android-26
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.android.support:support-v4:26.1.0
cordova.gradle.include.2=cordova-plugin-googlemaps/app-tbxml-android.gradle
cordova.system.library.3=com.android.support:support-core-utils:26.1.0
cordova.system.library.4=com.google.android.gms:play-services-maps:15.0.0
cordova.system.library.5=com.google.android.gms:play-services-location:15.0.0

So if you use CLI "cordova build", it will overwrite the dependencies section:

dependencies {
    implementation fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START 
   /* section being overwritten by cordova, referencing project.properties */
...
    // SUB-PROJECT DEPENDENCIES END
}

If you are using proper libraries and its versions in project.properties, you should be fine.


I had the same error, but don't know why it appeared. After searching solution I migrated project to AndroidX (Refactor -> Migrate to AndroidX...) and then manually changed whole classes imports etc. and in layout files too (RecyclerViews, ConstraintLayouts, Toolbars etc.). I changed also compileSdkVersion and targetSdkVersion to 28 version and whole project/application works fine.


If anybody has this error using phonegap or cordova with the cordova-plugin-fcm-ng or cordova-plugin-fcm plugin, the solution that worked for me is creating the extra config file for gradle "build-extras.gradle" in the \platforms\android\app folder, and putting the following lines in it

configurations.all {
 resolutionStrategy {
  force 'com.google.firebase:firebase-messaging:18.0.0'
  force 'com.google.firebase:firebase-core:16.0.8'
 }
}

I found this solution reading this page https://github.com/facebook/react-native/issues/25371, in particular comment of shreyakupadhyay on 30/07/19 and consulting https://developers.google.com/android/guides/releases#may_07_2019 about last libraries version.


For Ionic 3 devs. I had to update the platforms/android/project.properties file ONLY on:

cordova.system.library.2

to be v4:28.0.0+ otherwise the build kept failing.

After doing so, my project.properties file contents are shown below:

target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.system.library.2=com.android.support:support-v4:28.0.0+
cordova.system.library.3=com.android.support:support-v4:+
cordova.system.library.4=com.android.support:support-v4:25.+
cordova.system.library.5=com.android.support:appcompat-v7:25.+
cordova.gradle.include.1=cordova-plugin-googlemaps/starter-tbxml-android.gradle
cordova.system.library.6=com.google.android.gms:play-services-maps:15.0.1
cordova.system.library.7=com.google.android.gms:play-services-location:15.0.1
cordova.system.library.8=com.android.support:support-core-utils:26.1.0
cordova.system.library.9=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.gradle.include.2=cordova-android-support-gradle-release/pasma-cordova-android-support-gradle-release.gradle

I hope this helps someone. Was a real problem for me.


This was a pain in the ass for me! Especially after updating to Android Studio 3.2.1 and Gradle 4.6 (for Gradle developers).

I think there is more than one factor that could cause such a build exception. For me, I had the following lines of code in my gradle.properties file (using SDK version 27):

android.useAndroidX=true
android.enableJetifier=true

AndroidX is the alternative to Android's default Support Library and should be used when compiling and targeting SDK version 28 (API 28). Before the updating Android Studio and Gradle, I had added the lines above in preparation to eventually fully migrate to AndroidX to use SDK version 28 and the build ran successfully. It was only after the update that I received an error similar to that above:

error: resource android:attr/fontVariationSettings not found

Hope this helps.


For me : My external library was using this attributes attr/fontVariationSettings and attr/ttcIndex so I downgrade my library version and sync project . everything fine

So now :

 compileSdkVersion 27 
 implementation 'com.android.support:appcompat-v7:27.1.1'

and for future readers that library was google's easypermission.

implementation 'pub.devrel:easypermissions:2.0.0'

This lib is using sdkversion 28, I have to downgrade to 1.3.0


If you have stumbled upon this problem due to getting this error recently out of nowhere in react native- this is due to the latest BREAKING CHANGE in Google Play service and Firebase. Check this thread first -

https://github.com/facebook/react-native/issues/25293

And solution would mostly be like this -

https://github.com/facebook/react-native/issues/25293#issuecomment-503045776


I have soled the problem by changing target android version to 28 in project.properties (target=android-28) and installed cordova-plugin-androidx and cordova-plugin-androidx-adapter.


error: resource android:attr/fontVariationSettings not found

I got this error when i added ButterKnife library but upgrading compileSdkVersion to 28 and targetSdk to 28 solved my issue.


after upgrading to Android 3.4.2 and FTC SDK5.2. I got these errors when building APK:

Android resource linking failed C:\Users\idsid\FTC\SkyStone\TeamCode\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1205: error: resource android:attr/fontVariationSettings not found. C:\Users\idsid\FTC\SkyStone\TeamCode\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1206: error: resource android:attr/ttcIndex not found. error: failed linking references.

What I did is to add following section to project build gradle and problem is fixed.

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 28
                buildToolsVersion '29.0.2'
            }
        }
    }
}

Good luck.

참고URL : https://stackoverflow.com/questions/49208772/error-resource-androidattr-fontvariationsettings-not-found

반응형