hui-z / image_gallery_saver

flutter中用于保存图片到相册的Plugin
MIT License
275 stars 377 forks source link

APK build failed #320

Open MrCoder75 opened 3 weeks ago

MrCoder75 commented 3 weeks ago

When i try to build apk it gives the following error

Execution failed for task ':image_gallery_saver:verifyReleaseResources'.

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

 The issue i think is with the plugin because when i remove it and then try to build apk it builds sucessfully.
eansharma commented 3 weeks ago

The code project lavel build.gradel file is added. my case resolves issue

allprojects { ext.kotlin_version = '1.8.0' repositories { google() mavenCentral() } }

rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" afterEvaluate { android { compileSdkVersion 34 } } } subprojects { project.evaluationDependsOn(":app") }

tasks.register("clean", Delete) { delete rootProject.buildDir }

austincparker commented 2 weeks ago

The code project lavel build.gradel file is added. my case resolves issue

allprojects { ext.kotlin_version = '1.8.0' repositories { google() mavenCentral() } }

rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" afterEvaluate { android { compileSdkVersion 34 } } } subprojects { project.evaluationDependsOn(":app") }

tasks.register("clean", Delete) { delete rootProject.buildDir }

Thanks for this - I have a lot of packages installed so this is a more targeted workaround, but yours helped me get there.

subprojects {
    // TODO: Remove this when image_gallery_saver is updated to support Flutter 3.24.3
    if (project.name == "image_gallery_saver") {
        afterEvaluate {
            android {
                compileSdkVersion 34
            }
        }
    }
}
knottx commented 2 weeks ago

Try this #295

shahbazgondalnew commented 1 day ago

it also works for me, i just add the following lines subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" afterEvaluate { android { compileSdkVersion 34 } } }