Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed on AGP 4.2.2 when target/compileSdkVersion 34 #1223

Open
5 tasks done
LeeSeungYun1020 opened this issue Nov 14, 2023 · 17 comments
Open
5 tasks done

Build failed on AGP 4.2.2 when target/compileSdkVersion 34 #1223

LeeSeungYun1020 opened this issue Nov 14, 2023 · 17 comments

Comments

@LeeSeungYun1020
Copy link

LeeSeungYun1020 commented Nov 14, 2023

Checklist before submitting a bug report

Java version

11.0.17

Android version

API 34, Android 14

Android SDK version

15.0.2

Installation platform & version

Gradle 6.7.1

Package

Core & AppEvents

Goals

Build failed when I changed targetSdkVersion and compileSdkVersion 33 to 34.

> Task :app:processDebugResources FAILED

Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > AAPT2 aapt2-4.2.2-7147631-osx Daemon #0: Unexpected error during link, attempting to stop daemon.
     This should not happen under normal circumstances, please file an issue if it does.

I found that the build was successful if I excluded the androidx.legacy.legacy-support-v4 library.

    implementation ('com.facebook.android:facebook-android-sdk:15.0.2')
            {
        exclude group: "androidx.legacy", module: "legacy-support-v4"
    }

Please check whether there are any operation problems even if I exclude the androidx.legacy.legacy-support-v4 library.

Expected results

Build successful

Actual results

Build failed

Steps to reproduce

AGP 4.2.2 / gradle 6.7.1 / targetSdkVersion 34 / compileSdkVersion 34 / buildToolsVersion 30.0.3

Code samples & details

My Project Environment: AGP 4.2.2 / gradle 6.7.1 / targetSdkVersion 34 / compileSdkVersion 34 / buildToolsVersion 30.0.3

It seems to be a problem with the `androidx.legacy.legacy-support-v4` library rather than a facebook library problem.
So I would like to know if I can exclude the `androidx.legacy.legacy-support-v4` library.

Thanks.
@LeeSeungYun1020
Copy link
Author

I also checked latest version.

implementation 'com.facebook.android:facebook-android-sdk:latest.release'

@bf234511171
Copy link

same failed

@aidoTank
Copy link

same too,Unity 2020 must use AGP 4.2.2

@sunilanumolu
Copy link

same issue here, any solution found?

@cristian1206
Copy link

Hello everyone, I have the same problem, and it actually appears when I update to Android 14. Have any of you solved it?

@LeeSeungYun1020
Copy link
Author

LeeSeungYun1020 commented May 15, 2024

Sorry for sharing late.
Including androidx.legacy:legacy-support-v4 library causes build error.
So I exclude legacy-suppory-v4 lib in my project.

implementation ('com.facebook.android:facebook-android-sdk:15.0.2') {
    exclude group: "androidx.legacy", module: "legacy-support-v4"
}

I tested login function; it is working well.
And it is still working well without any problems.

@Awais6
Copy link

Awais6 commented May 26, 2024

Unity 2021.3.38f1 LTS,
Facebook SDK LATEST 17.0.1
Build IL2CPP Android min sdk level 22, target sdk level 34,

same bug here, build failed

why facebook SDK always have too much bugs?
we have lost many days to figure out, facebook SDK is causing error on build.

image

@PrasanthDante03
Copy link

any update, same issue i am facing

@shahanaahmad
Copy link

I resolved the issue by following the below link. Please update gradle plugin version in project level build.gradle file.
(https://stackoverflow.com/a/77622916/13816285)

@PrasanthDante03
Copy link

@shahanaahmad I understand that, but if I try to upgrade the gradle now, it will throw errors in the dependencies used in my React Native project, which is 3 years old. I can't do it at the moment. Is there any other way to resolve this?

@chenxi92
Copy link

Sorry for sharing late. Including androidx.legacy:legacy-support-v4 library causes build error. So I exclude legacy-suppory-v4 lib in my project.

implementation ('com.facebook.android:facebook-android-sdk:15.0.2') {
    exclude group: "androidx.legacy", module: "legacy-support-v4"
}

I tested login function; it is working well. And it is still working well without any problems.

@LeeSeungYun1020 It works for me, thanks for your solution

@ibilalchaudhary
Copy link

updates targetsdkversion to 34 if you're targeting to android 14, but keep compileSdkVersion to 32

@arifhussain502
Copy link

Unity 2021.3.38f1 LTS, Facebook SDK LATEST 17.0.1 Build IL2CPP Android min sdk level 22, target sdk level 34,

same bug here, build failed

why facebook SDK always have too much bugs? we have lost many days to figure out, facebook SDK is causing error on build.

image

Have you got any solution for this? i have same problem

@tehKaiN
Copy link

tehKaiN commented Aug 1, 2024

Try with Unity 2021.3.41f1 - it has upgraded android toolchain to significantly more recent version.
I've ultimately scrapped FB integration in my projects, so dunno if that helps, but it helped me with other packages giving similar errors. Or, rather it replaced this error with a more meaningful one which I've managed to fix.

I've read that ppl are still having problems though, and .42f1 is on the way to mitigate those.

@PrasanthDante03
Copy link

Sorry for sharing late. Including androidx.legacy:legacy-support-v4 library causes build error. So I exclude legacy-suppory-v4 lib in my project.

implementation ('com.facebook.android:facebook-android-sdk:15.0.2') {
    exclude group: "androidx.legacy", module: "legacy-support-v4"
}

I tested login function; it is working well. And it is still working well without any problems.

@LeeSeungYun1020 It works for me, thanks for your solution

@LeeSeungYun1020 Throws new error.

AAPT2 aapt2-4.2.2-7147631-osx Daemon #0: Unexpected error during link, attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.

@LeeSeungYun1020
Copy link
Author

You can check other libraries, such as support-v13 or other libraries that include support-v4 in their dependencies.

@PrasanthDante03
Copy link

updates targetsdkversion to 34 if you're targeting to android 14, but keep compileSdkVersion to 32

@LeeSeungYun1020 After applying this
implementation ('com.facebook.android:facebook-android-sdk:15.0.2') {
exclude group: "androidx.legacy", module: "legacy-support-v4"
}

Also changing like this solve my problem.
"updates targetsdkversion to 34 if you're targeting to android 14, but keep compileSdkVersion to 32"

Thanks, works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests