'Audioplayers' package doesn't run

I am adding the ‘audioplayers’ package to my project and it run successfully on chrome, but when I run the same code in emulator it gives compile time error, I tried many solutions from stackoverflow and others communities but nothing works with me, any help please.
the message that appears with error :

'FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘android’.

Could not resolve all artifacts for configuration ‘:classpath’.
Could not find com.android.tools.build:gradle:7.0.2.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.0.2/gradle-7.0.2.pom
- https://repo1.maven.org/maven2/com/android/tools/build/gradle/7.0.2/gradle-7.0.2.pom
- there is another link here but I couldn’t add it because new users cannot add more than two links
Required by:
project :

  • 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

Exception: Gradle task assembleDebug failed with exit code 1’

thx in advance.

I think you can try changing the gradle version in /android/gradle/wrapper/gradle-wrapper.properties

1 Like

I tried but the error still appear … can you please tell me what is the version that I should change to ?
Or what does it depend on ?