endmr11 / ed_screen_recorder

Screen recorder plugin for Flutter. Supports IOS and Android devices.
MIT License
26 stars 36 forks source link

Cannot build apk after adding this package to my pubspec.yaml file. #7

Open Usamamajid13 opened 2 years ago

Usamamajid13 commented 2 years ago

I am getting this error when I try to run the command flutter build akp

* What went wrong:
Execution failed for task ':ed_screen_recorder:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > 1 exception was raised by workers:
     com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
     C:\Users\usama\.gradle\caches\transforms-3\213a50da74ca5943e43b6a60fa7c8adf\transformed\core-1.7.0\res\values\values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

After running flutter doctor in the project

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19043.1706], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[!] Visual Studio - develop for Windows (Visual Studio Professional 2022 17.1.4)
    X The current Visual Studio installation is incomplete. Please reinstall Visual Studio.
[√] Android Studio (version 2021.2)
[√] Connected device (3 available)
[√] HTTP Host Availability

! Doctor found issues in 1 category.

Extended Version of flutter doctor.

flutter doctor -v
[√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19043.1706], locale en-US)
    • Flutter version 2.10.5 at D:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (7 weeks ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\usama\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: D:\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop for Windows (Visual Studio Professional 2022 17.1.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Professional
    • Visual Studio Professional 2022 version 17.1.32407.343
    X The current Visual Studio installation is incomplete. Please reinstall Visual Studio.

[√] Android Studio (version 2021.2)
    • Android Studio at D:\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19043.1706]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 102.0.5005.63
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 101.0.1210.53

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Please help me with this issue. Thank you!

endmr11 commented 2 years ago

The problem may not be related to the package. Can you please take a look at this issue? https://stackoverflow.com/questions/52512326/com-android-builder-internal-aapt-v2-aapt2exception-android-resource-compilatio

Usamamajid13 commented 2 years ago

I have checked the link and I changed the compileSdkVersion version of my project from 31 to 28 but I was not successful building the apk file. Then I changed the compileSdkVersion of the ed_screen_recorder package from 30 to 28. After changing the version I am still not able to develop the .apk file.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ed_screen_recorder:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > 1 exception was raised by workers:
     com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
     C:\Users\usama\.gradle\caches\transforms-3\213a50da74ca5943e43b6a60fa7c8adf\transformed\core-1.7.0\res\values\values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not fo
und.

* 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 3m 54s
endmr11 commented 2 years ago

Can you try clearing the cache from the Android Studio program and then opening the android folder and getting a build?

Usamamajid13 commented 2 years ago

Yes I tried that as well.

Usamamajid13 commented 2 years ago

Application is running smoothly but extracting build is causing the issue. Everything else is working smoothly and very well.

Div-47 commented 2 years ago

same issue with me , its running perfect in debug mode , but when it comes to building release build, its not working. build failed with "Resource linking failed".

h1376h commented 2 years ago

Same issue here too. Can't build with newer gradle versions and the default flutter project's gradle is now 7.1.2, so any new project will probably fail.

I made a pr that adds a workflow that works fine with current version and 4.1.2 gradle, but shows you the exact error if you change the gradle version and gradle plugin version (wrapper) to 7.1.2 and 7.4-all.

montanarograziano commented 2 years ago

Same issue here. Have you find any solution to this?

adnanatif commented 2 years ago

same issue faced anybody find the solution?

Usamamajid13 commented 2 years ago

I haven't found the solution for that so I didn't used this package.

endmr11 commented 1 year ago

Version 0.0.13 has been released. Could you please check again and report back to me?

h1376h commented 1 year ago

The issue is fixed and now I can build apk after adding the package, but the package doesn't work (couldn't record the screen, even when using the example code) on my phone. (Poco F3, Android 13)

endmr11 commented 1 year ago

@h1376h I tried it on poco nfc x3 model phone and it works.