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

Problem Building in Release Mode #158

Closed
SubutaDan opened this issue Sep 4, 2024 · 4 comments
Closed

Problem Building in Release Mode #158

SubutaDan opened this issue Sep 4, 2024 · 4 comments

Comments

@SubutaDan
Copy link

I am unable to build my Flutter app. that uses social_share in Release mode. I am getting this message:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':social_share:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/Users/dan/git/kokodoko_flutter_client/build/social_share/intermediates/merged_res/release/values/values.xml:194: AAPT: error: resource android:attr/lStar not found.

When I try to build in Release mode I also get numerous error messages about a Kotlin version incompatibility, for example:

e: /Users/dan/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/2.0.20/7388d355f7cceb002cd387ccb7ab3850e4e0a07f/kotlin-stdlib-2.0.20.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.6.0.

I think the two are related, but I don't know for sure.

I have done some googling and tried some recommended fixes and workarounds but have not been able to execute the build in Release mode.

I think this problem may have begun when I upgraded Flutter, but downgrading doesn't seem to resolve the issue.

% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.1, on macOS 14.5 23F79 darwin-arm64, locale en-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.92.2)
[✓] Connected device (4 available)            
    ! Error: Browsing on the local area network for iPhone (4). Ensure the device is unlocked and attached with a cable or associated
      with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

Anyone else encountering this? Any suggestions for resolving?

Thank you for your help.

@akbarpour814
Copy link

same too

@slovnicki
Copy link

Adding this into android/build.gradle solved it for me

subprojects { afterEvaluate { android { compileSdkVersion 34 } } }

(if you have some existing subprojects blocks, make this one be the first)

Here's a comment I found that explained it in more detail: transistorsoft/flutter_background_fetch#369 (comment)

@SubutaDan
Copy link
Author

Thank you, slovnicki. After following your suggestion I am able to build my app in release mode.

@akbarpour814
Copy link

slovnicki

Thank you, slovnicki. it's work for me too

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

3 participants