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

Flutter v3.24.1 can not build on Android #70

Open
omartinma opened this issue Sep 9, 2024 · 6 comments
Open

Flutter v3.24.1 can not build on Android #70

omartinma opened this issue Sep 9, 2024 · 6 comments

Comments

@omartinma
Copy link

omartinma commented Sep 9, 2024

Hi,

I'm currently using in my project the Flutter version 3.19.3. When upgrading to 3.24.1 I'm not able to build the Android project anymore, and I'm seeing this issue.

What is the maximum Flutter version supported by the library at the moment?

Thanks!

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
ERROR:/Users/myprofile/.gradle/caches/transforms-3/ce81779b4f1a3bd17c8fa4641cb4f760/transformed/jetified-appcompat-resources-1.7.0-runtime.jar: D8: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null
ERROR:/Users/myprofile/.gradle/caches/transforms-3/9749eb58411c3c662945afefe8b3d132/transformed/appcompat-1.7.0-runtime.jar: D8: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform appcompat-resources-1.7.0.aar (androidx.appcompat:appcompat-resources:1.7.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/myprofile/.gradle/caches/transforms-3/ce81779b4f1a3bd17c8fa4641cb4f760/transformed/jetified-appcompat-resources-1.7.0-runtime.jar.
         > Error while dexing.
   > Failed to transform appcompat-1.7.0.aar (androidx.appcompat:appcompat:1.7.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/myprofile/.gradle/caches/transforms-3/9749eb58411c3c662945afefe8b3d132/transformed/appcompat-1.7.0-runtime.jar.
         > Error while dexing.

It seems that blinkcard does not have the issue and it can run individually, but If i add both dependencies to the project the error message that I get is different:

   /Users/myprofile/.gradle/caches/transforms-3/2fd16129e9d0f64b53494b89029c54ce/transformed/jetified-blinkcard-2.9.3/res/values/values.xml:427:4: Duplicate value for resource 'attr/mb_onboardingImageColor' with config 'DEFAULT' and product ''. Resource was previously defined here: com.example.microblink_example.app-mergeDebugResources-31:/values/values.xml:3099: .
/Users/myprofile/.gradle/caches/transforms-3/fac84cd5ecf1ec88a8c98571217c9350/transformed/core-1.13.1/res/values/values.xml:176:4: Duplicate value for resource 'attr/mb_helpTooltipColor' with config 'DEFAULT' and product ''. Resource was previously defined here: com.example.microblink_example.app-mergeDebugResources-31:/values/values.xml:3205: .

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
   > Resource compilation failed (Failed to compile values resource file /Users/myprofile/microblink_example/build/app/intermediates/incremental/debug/mergeDebugResources/merged.dir/values/values.xml. Cause: java.lang.IllegalStateException: Can not add resource (com.android.aaptcompiler.ParsedResource@3ff6c7fa) to table.,Can not add resource (com.android.aaptcompiler.ParsedResource@3bc954dc) to table.). Check logs for more details.
@somyaguptagit
Copy link

Hi @omartinma Thank you for reaching out! When you say you add both dependencies, do you mean BlinkID+BlinkCard(flutter)? could you also provide us additional logs of the exception?
You can also reach out to us directly at [email protected] and we can assist you further.

@omartinma
Copy link
Author

Hi @omartinma Thank you for reaching out! When you say you add both dependencies, do you mean BlinkID+BlinkCard(flutter)? could you also provide us additional logs of the exception? You can also reach out to us directly at [email protected] and we can assist you further.

Exactly @somyaguptagit, adding BlinkID and BlinkCard both using the latest version. Unfortunately, there are no more logs than what I provided. Not sure why the error message shown is different when adding both dependencies rather than only adding BlinkID.

I was able to replicate this in a clean project using flutter create and adding the dependency.

Let me know if you need more details.

Thanks!

@radivojeostojic
Copy link

radivojeostojic commented Sep 12, 2024

@omartinma I had a similar issue yesterday, and I had to update the Android Gradle Plugin version to 8.1.3 to make it work.

@mparadina
Copy link
Contributor

Hi @radivojeostojic and @omartinma

@radivojeostojic that is correct, updating to Gradle v8 should resolve the issue. Thank you for responding.
I will update this information in the documentation in the upcoming release.

@omartinma
Copy link
Author

Thanks both for your replies @radivojeostojic @mparadina.

Actually, I was using Gradle 8.7 with Android Gradle Plugin 8.5. I tried to use 8.1.3 and I'm still getting the same error when I combine the 2 libraries. If I use blinkid_flutter only I can run the project perfectly.

@omartinma
Copy link
Author

Do we have any update about this topic? @somyaguptagit @mparadina Thanks!

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

No branches or pull requests

4 participants