-
Notifications
You must be signed in to change notification settings - Fork 430
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
Problem: Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl #316
Comments
I am also getting the same error FAILURE: Build completed with 2 failures. 1: Task failed with an exception.
2: Task failed with an exception.
BUILD FAILED in 4s |
I had the same issue but moving over to https://pub.dev/packages/image_gallery_saver_plus fixed the problem for me. It has the same API so should be an easy switch. |
I'm having this problem with several libraries that haven't been updated for years. It's a trifle to resolve Just find the plugin inside /External Libraries/Flutter Plugins. Open the build.gradle (inside android folder) and add this line:
Then go to AndroidManifest (folder: image_gallery_saver/android/src.main) and remove package="com.example.imagegallerysaver" @Zambrella he certainly said the right thing to do, but I still wanted to explain how to solve it because you may encounter the same problem with other libraries that however do not have valid or applicable alternatives |
I am still trying to find a logical solution for it... and i hope so :) |
In order to make not fully up-to-date packages work in Android with all the latest requirements, you can add this additional subprojects-block to your subprojects {
afterEvaluate {
project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 34
compileOptions {
targetCompatibility = JavaVersion.VERSION_1_8
}
if (namespace == null) {
namespace project.group
}
}
}
}
} What it basically does is on compile time add the necessary compileSdkVersion, javaversion and namespace, that are in my experience things that might break your app. In this block, the |
Try this #295 |
use image_gallery_saver_plus: '^3.0.5', flutter 3.24.3 was compiled sucess |
A problem occurred configuring project ':image_gallery_saver'.
BUILD FAILED in 5s
Error: Gradle task assembleDebug failed with exit code 1
The text was updated successfully, but these errors were encountered: