dreamsoftin / facebook_audience_network

Flutter Facebook Audience Network
https://pub.dartlang.org/packages/facebook_audience_network/
MIT License
156 stars 89 forks source link

Got error verifyReleaseResources when trying to build release apk #844 #153

Open istiaksaif opened 1 month ago

istiaksaif commented 1 month ago

:facebook_audience_network:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action Android resource linking failed ERROR:/home/istaiksaif/Documents/Sports76/build/facebook_audience_network/intermediates/merged_res/release/values/values.xml:194: AAPT: error: resource android:attr/lStar not found.

DevanshiGor commented 1 month ago

I am also facing the same issue with Flutter 3.24.x... Please suggestion some workaround. Thanks in advance !!

Alvish0407 commented 1 week ago

try adding the code block highlighted below to the android/build.gradle file in your project directory.

rootProject.buildDir = "../build"
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
+    afterEvaluate {
+        android {
+            compileSdkVersion 34
+        }
+    }
}
istiaksaif commented 5 days ago

Try this workaround:

Change (at android/build.gradle):

subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

To:

subprojects {
    afterEvaluate { project ->
        if (project.plugins.hasPlugin("com.android.application") ||
                project.plugins.hasPlugin("com.android.library")) {
            project.android {
                compileSdkVersion 34
            }
        }
    }
}
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    project.evaluationDependsOn(':app')
}

The solution currently works. flutter version 3.24.3