skip to Main Content

Hello everyone sorry for misleading title did not know what to put there.
The problem is while I import hive and hive_flutter or even add them to pub my project get the following error:

Execution failed for task ':path_provider_android:parseDebugLocalResources'.
> Could not resolve all files for configuration ':path_provider_android:androidApis'.
   > Failed to transform android.jar to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for PlatformAttrTransform: C:UsersshahahmadianAppDataLocalAndroidSdkplatformsandroid-31android.jar.
         > C:UsersshahahmadianAppDataLocalAndroidSdkplatformsandroid-31android.jar

which if I would like to be specific is because of:

Task :path_provider_android:compileDebugLibraryResources UP-TO-DATE
[        ] Caching disabled for task ':path_provider_android:compileDebugLibraryResources' because:
[        ]   Build cache is disabled
[   +1 ms] Skipping task ':path_provider_android:compileDebugLibraryResources' as it is up-to-date.
[        ] :path_provider_android:compileDebugLibraryResources (Thread[included builds,5,main]) completed. Took 0.001 secs.
[        ] :path_provider_android:parseDebugLocalResources (Thread[included builds,5,main]) started.
[   +1 ms] > Task :path_provider_android:parseDebugLocalResources FAILED
[        ] Transforming android.jar with PlatformAttrTransform
[   +1 ms] Caching disabled for PlatformAttrTransform: C:UsersshahahmadianAppDataLocalAndroidSdkplatformsandroid-31android.jar because:
[   +2 ms]   Build cache is disabled
[   +1 ms] PlatformAttrTransform: C:UsersshahahmadianAppDataLocalAndroidSdkplatformsandroid-31android.jar is not up-to-date because:
[  +49 ms]   Task has failed previously.

These logs are from flutter run -v
and the message followed by this error log is:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[        ] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[        ] See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings
[        ] 24 actionable tasks: 5 executed, 19 up-to-date

now my flutter doctor is:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19045.2311], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.1)
[√] Android Studio (version 2021.3)
[√] VS Code (version 1.74.2)
[√] Connected device (4 available)
[√] HTTP Host Availability

• No issues found!

I have tried to change minsdk version and also target and compile sdk version
as I assume the problem is because of gradle version and I’m going to downgrade my gradle version.
I would be thankful for you guys to tell me what the problem is and alternatives for fixing this issue.

2

Answers


  1. Chosen as BEST ANSWER

    thanks to @lakshydeep vikram sah when I checked sdk manager it said I have the latest 31 sdk and could not update to a newer version. the problem was that files of sdk 31 was missing so I copied android.jar file from sdk 33 and paste it in sdk 31 folder now every thing is running fine. but still I don't know why this error came up while i tried to use hive!!!!! enter image description here


  2. It is seeking for android 31 sdk but did not find.
    Try installing sdk for android 31.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search