transistorsoft / capacitor-background-fetch

Periodic callbacks in the background for both IOS and Android
78 stars 9 forks source link

Migration to Capacitor 3 Error: Could not find any matches for com.transistorsoft:tsbackgroundfetch:+ #5

Closed eduboxgithub closed 3 years ago

eduboxgithub commented 3 years ago

Your Environment

Expected Behavior

Install the plugin and after the plugin setup, be able to run and build de android project.

Actual Behavior

The app shows an error during build time reporting that can't find any matches for com.transistorsoft:tsbackgroundfetch:+

Steps to Reproduce

  1. Install the plugin npm install --save @transistorsoft/capacitor-background-fetch

  2. Add build.gradle config image

  3. Add proguard-rules-pro config image

  4. Try to build the Capacitor App using Android Studio

Context

I'm migrating my app to Capacitor 3. My app makes use of capacitor-background-geolocation. I was using the cordova version, but I noticed that there's a new Capacitor version, so I'm trying to use the new version.

Already did the migrations steps for the capacitor-background-geolocation and the capacitor-background-fetch, but seems there's an issue. I double checked the setup steps but I'm getting this the error reported above in the logs.

Debug logs

:app:mergeDebugResources
Could not resolve any matches for com.transistorsoft:tsbackgroundfetch:+ as no versions of com.transistorsoft:tsbackgroundfetch are available
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find any matches for com.transistorsoft:tsbackgroundfetch:+ as no versions of com.transistorsoft:tsbackgroundfetch are available.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml
       - https://jcenter.bintray.com/com/transistorsoft/tsbackgroundfetch/maven-metadata.xml
       - file:/D:/_git/sAPP/sAPP/android/capacitor-cordova-android-plugins/src/main/libs/
       - file:/D:/_git/sAPP/sAPP/android/app/libs/
     Required by:
         project :app > project :transistorsoft-capacitor-background-fetch

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
christocracy commented 3 years ago

You did not follow the Setup Steps for background-fetch.

christocracy commented 3 years ago

https://github.com/transistorsoft/capacitor-background-fetch/blob/master/help/INSTALL-ANDROID.md

eduboxgithub commented 3 years ago

Sorry, for your wasted time... :(

Somehow I forgot/replace one of the maven repo declarations.

Changed to:

image

... and it's working! Thank you.

Abolfazl-MI commented 2 years ago

Hi there I have same issue using flutter_background_service,in the pub dev there is no thing guied me to config my project and here is my errors please help me I need backgroud service witch can provide me an secounds handleer to fire function `FAILURE: Build failed with an exception.

christocracy commented 2 years ago

Post your android/build.gradle

bahamut657 commented 2 years ago

Same error here. Here you are the build.gradle content:


buildscript {
    ext.kotlin_version = '1.6.10'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
christocracy commented 2 years ago

You did not follow the required Setup Instructions linked in the readme.

pencilcheck commented 2 years ago

it has to be in allprojects {} not buildscript, you need to scroll down a bit further. Not sure why they duplicate this section, very stupid.