Closed Milimeter closed 5 months ago
Thanks for reporting this issue with a lot of details.
It seems that only the external package image_editor
is the problem. Currently, this package and the extended_image
package are required for the crop/rotate editor. I have a plan to remove both packages completely in the future with a better solution. In the dev
branch you can see the progress and if you want you can also help to replace the current crop/rotate editor. However, these changes will take a lot of time, which I do not have at the moment.
The other option is if you open a new issue in the image_editor
package, maybe the owner will fix it then. I try to update always all packages so that will also resolve the issue then.
There is a new update 2 days ago on image_editor
. They added AGP 8 support for Android. Fixing the issue i raised. How soon would you be able to update the dependency?
Thank you for your hard work in the community brother :)
Thanks for the info bro. I updated and released it right away ;)
Can you reopen this as the error still exists. Can you try to make a build with the specifications to test this out?
Hmm, I don't know why, but I can't reproduce this problem after updating the image_editor
package. May I ask, have you already run flutter clean
? If you have already run this command can I maybe take a look at your files like build.gradle
, gradle-wrapper.properties
and settings.gradle
maybe I can reproduce it then.
Okay. I will share them:
Settings.gradle `pluginManagement { def flutterSdkPath = { def properties = new Properties() file("local.properties").withInputStream { properties.load(it) } def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath } settings.ext.flutterSdkPath = flutterSdkPath()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
repositories { google() mavenCentral() gradlePluginPortal() } }
plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "8.2.2" apply false id "org.jetbrains.kotlin.android" version "1.9.22" apply false id "com.google.gms.google-services" version "4.4.0" apply false }
include ":app"`
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
build.gradle(app level) `plugins { id "com.android.application" id "org.jetbrains.kotlin.android" id "dev.flutter.flutter-gradle-plugin" id "com.google.gms.google-services" }
def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } }
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' }
def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' }
def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties') if (keystorePropertiesFile.exists()) { keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) }
android { namespace "com.tech.app" compileSdkVersion 34 ndkVersion "26.2.11394342"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.tech.app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 26
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null storePassword keystoreProperties['storePassword'] } }
buildTypes {
release {
shrinkResources true
minifyEnabled true
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
}
}
flutter { source '../..' }
dependencies { implementation 'com.google.firebase:firebase-messaging:20.1.0' implementation platform('com.google.firebase:firebase-bom:32.7.4') implementation 'com.google.firebase:firebase-analytics' } `
I will try to flutter clean once again to validate
just tried it. Still the same.
FAILURE: Build completed with 2 failures.
What went wrong: A problem occurred configuring project ':image_editor_common'.
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl. Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org.
What went wrong: Failed to query the value of property 'buildFlowServiceProperty'.
Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@632bcbc5 of type BuildFlowService.Parameters A problem occurred configuring project ':image_editor_common'. Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl. Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org.
BUILD FAILED in 23s Error: Gradle task assembleDebug failed with exit code 1
Thanks for testing with flutter clean
. When I use your configurations, I also run into this issue. The problem is I can't fix this issue cuz it is still from the package image_editor_common
which is used by the package image_editor
. We can only wait or report this issue in the image_editor
package and hope they will fix this issue quickly.
I still have the plan to remove this package and create an own solution for the crop/rotate editor, but currently I don't have much time to do this task cuz it need a lot of time.
Getting similar errors, and stuff like crop and rotate aren't working. I would love to see a solution to this! Thanks again for all your hard work on this project, it is a gem!
Thanks Azam for your feedback.
Yeah, I think the only good solution now is to completely replace the existing crop-rotate-editor, which currently depends on the image_editor
, extended_image
and image
packages. This will not only solve this problem, it will also speed up the editor, and we will be able to export only the states of the transformation, not full images of how the image is cropped.
However, as you guys can see in the dev branch, I have already started to create my own solution for this editor. There are many tasks to do, so I don't know how long I will need to finish these tasks. If some of you have free time and want to help a little bit to finish these tasks, I will post below all the tasks we need to do.
_mouseScroll
. Make sure that the user cannot move out of the image after zooming.crop_corner_painter
we need to create custom aspect ratio options like 4/3, and we should also create a rounded cropper which will be useful for cropping profile pictures.TransformedContentGenerator
which applies all changes to the other editors, we need to cut the content that is outside the cropped area._rotateLayer
, _flipLayer
and _zoomedLayer
for the old editor, so maybe we just need to edit these methods.Hey Everyone,
For all of you who are running in this issue and still want/need to use the new Gradle version from Android, you can now try the “pre-release” here. This version replaces the crop rotate editor with a completely custom solution of mine. It's still a work in progress and has some issues and needs more testing, but it should work on every device now.
Please take a look at the changelog file first to get information about what is new and especially what breaking changes this update brings.
The list of open tasks to finish this project can be checked out here, so in case you find a problem, please check first if it's not already an open task.
When attempting to build a project that includes the pro_image_editor package, the build fails with a configuration error related to its dependency, image_editor version 1.3.0. The error is as follows: `1: Task failed with an exception.
What went wrong: A problem occurred configuring project ':image_editor_common'.
If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant. ` This suggests that the image_editor package has not been configured with a namespace, a requirement introduced in recent versions of the Android Gradle Plugin (AGP).
Steps to Reproduce Include pro_image_editor in a Flutter project's dependencies. Attempt to build the project for Android. Observe the build failure with the above error message.
Expected Behavior The project builds successfully without any configuration errors related to namespaces in dependencies.
Actual Behavior The build fails due to a missing namespace configuration in the image_editor package.
Suggested Fix According to the provided error message and the AGP documentation, it is necessary to specify a namespace in the module's build file for image_editor. This can be achieved by following the instructions provided in the AGP Upgrade Assistant documentation: . The necessary changes should be applied to the image_editor package to ensure compatibility with recent AGP versions and to avoid build failures due to unconfigured namespaces.
Additional Context Flutter version: 3.19.0 pro_image_editor version: ^2.5.7 image_editor version: 1.3.0 Android Gradle Plugin version: [include the version you are using] Gradle version: 8.2 Please let me know if you need any more information or if there's anything else I can do to help resolve this issue.