Could not find any matches for com.facebook.android:audience-network-sdk:6.+

427 Views Asked by At

Hello flutter developer i am using facebook_audience_network: ^1.0.1 plugin in my app for integrate facebook audience network ads .it was working fine even my app is live on playstore.Ads still showing int it today's. I want update my app adding some new feature when i debug my app for testing the ads i got this error below anyone tell me what is issue i thought it was plugin outdated now ?

Launching lib/main.dart on RMX2020 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find any matches for com.facebook.android:audience-network-sdk:6.+ as no versions of com.facebook.android:audience-network-sdk are available.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/facebook/android/audience-network-sdk/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/facebook/android/audience-network-sdk/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/facebook/android/audience-network-sdk/6.13.6/audience-network-sdk-6.13.6.pom
       - https://storage.googleapis.com/download.flutter.io/com/facebook/android/audience-network-sdk/maven-metadata.xml
       - https://jcenter.bintray.com/com/facebook/android/audience-network-sdk/maven-metadata.xml
       - https://jcenter.bintray.com/com/facebook/android/audience-network-sdk/6.13.6/audience-network-sdk-6.13.6.pom
     Required by:
         project :app > project :facebook_audience_network

* 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 45s
Exception: Gradle task assembleDebug failed with exit code 1
2

There are 2 best solutions below

1
Yutik Gujarati On

click to open image

This is the temporary solution.because i am not able to update this packge so. please check steps in image and add selected code in your facebook_audience_network packge.it's working in my all projects.

  • please add sdk version same as your app/gradle file it's 99% working. only issue with sdk version specification.
  • and also comment old sdk.
0
Hamza Tahir On

Solution

In pubspec.yaml depend on https://github.com/azmasamy/facebook_audience_network.git instead of facebook_audience_network: ^1.0.1

like this:

  # facebook_audience_network: ^1.0.1
  facebook_audience_network:
    git:
      url: https://github.com/azmasamy/facebook_audience_network.git
      ref: master

Explanation

The problem is that the facebook_audience_network: ^1.0.1 depends on implementation 'com.facebook.android:audience-network-sdk:6.+' in build.gradle

It searches for the most recent version on Maven Central and for some reason it searches for 6.13.0 which doesn't exist.

I forked the latest version of facebook_audience_network: ^1.0.1 and modified the dependency so that it depends on the most recent version which is 6.12.0.