2

J'essaye de construire le projet mais c'est le message d'erreur que je reçois.Impossible de résoudre: com.firebase: firebase-jobdispatcher: 0.5.0

Error:(32, 13) Failed to resolve: com.firebase:firebase-jobdispatcher:0.5.0 
    Show in File 
    Show in Project Structure dialog 

    Error:Failed to resolve: com.android.databinding:compiler:2.2.3 
    Open File 
    Show in Project Structure dialog 

Voici le fichier de construction du module d'application: -

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 24 
buildToolsVersion '24.0.0' 

defaultConfig { 
    applicationId "com.example.android.sunshine" 
    minSdkVersion 10 
    targetSdkVersion 24 
    versionCode 1 
    versionName "1.0" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
    } 
} 

dataBinding.enabled = true 
} 

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
compile 'com.android.support:appcompat-v7:24.2.1' 

compile 'com.android.support:recyclerview-v7:24.2.1' 
compile 'com.android.support:preference-v7:24.2.1' 

compile 'com.android.support.constraint:constraint-layout:1.0.0-beta3' 

compile 'com.firebase:firebase-jobdispatcher:0.5.0' 

// Instrumentation dependencies use androidTestCompile 
// (as opposed to testCompile for local unit tests run in the JVM) 
androidTestCompile 'junit:junit:4.12' 
androidTestCompile 'com.android.support:support-annotations:24.2.1' 
androidTestCompile 'com.android.support.test:runner:0.5' 
androidTestCompile 'com.android.support.test:rules:0.5' 
} 

Voici le fichier de construction du module de projet complet: -

buildscript { 
repositories { 
    jcenter() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:2.2.3' 

    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
} 
} 

allprojects { 
String osName = System.getProperty("os.name").toLowerCase(); 
if (osName.contains("windows")) { 
    buildDir = "C:/tmp/${rootProject.name}/${project.name}" 
} 
repositories { 
    jcenter() 
} 
} 

task clean(type: Delete) { 
delete rootProject.buildDir 
} 

Voici la AndroidManifest.xml Fichier: -

<?xml version="1.0" encoding="utf-8"?> 
<!-- 
    Copyright (C) 2016 The Android Open Source Project 

    Licensed under the Apache License, Version 2.0 (the "License"); 
    you may not use this file except in compliance with the License. 
    You may obtain a copy of the License at 

      http://www.apache.org/licenses/LICENSE-2.0 

    Unless required by applicable law or agreed to in writing, software 
    distributed under the License is distributed on an "AS IS" BASIS, 
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
    See the License for the specific language governing permissions and 
    limitations under the License.--> 
<manifest 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.android.sunshine"> 

    <!-- This permission is necessary in order for Sunshine to perform network access. --> 
    <uses-permission android:name="android.permission.INTERNET"/> 

    <application 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme"> 

     <!--The manifest entry for our MainActivity. Each Activity requires a manifest entry--> 
     <activity 
      android:name=".MainActivity" 
      android:label="@string/app_name" 
      android:launchMode="singleTop" 
      android:theme="@style/AppTheme.Forecast"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN"/> 
       <category android:name="android.intent.category.LAUNCHER"/> 
      </intent-filter> 
     </activity> 

     <!--The manifest entry for our DetailActivity. Each Activity requires a manifest entry--> 
     <activity 
      android:name=".DetailActivity" 
      android:label="@string/title_activity_detail" 
      android:parentActivityName=".MainActivity" 
      android:theme="@style/AppTheme"> 
      <meta-data 
       android:name="android.support.PARENT_ACTIVITY" 
       android:value=".MainActivity"/> 
     </activity> 

     <!--The manifest entry for our SettingsActivity. Each Activity requires a manifest entry--> 
     <activity android:name=".SettingsActivity"/> 

     <!-- Our ContentProvider --> 
     <provider 
      android:name=".data.WeatherProvider" 
      android:authorities="@string/content_authority" 
      android:exported="false"/> 

     <!--This is required for immediate syncs --> 
     <service 
      android:name=".sync.SunshineSyncIntentService" 
      android:exported="false" /> 

     <!-- This is the Service declaration used in conjunction with FirebaseJobDispatcher --> 
     <service 
      android:name=".sync.SunshineFirebaseJobService" 
      android:exported="false"> 
      <intent-filter> 
       <action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE"/> 
      </intent-filter> 
     </service> 

    </application> 
</manifest> 

Comment puis-je résoudre ce problème? Je n'ai pas non plus de ressources sur internet.

Répondre

6

Il est mentionné sur github de la bibliothèque:

Si vous ne disposez pas d'une dépendance à l'égard com.google.android.gms: play-services-GCM, ajoutez ce qui suit à votre construction . la section des dépendances de gradle:

compile 'com.firebase:firebase-jobdispatcher:0.5.2'

ajouter Sinon les éléments suivants:

compile 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.5.2'

Et je ne vois aucune dépendance sur gms sur votre fichier gradle. Donc, vous devriez utiliser la deuxième dépendance.

Mise à jour (mai 2017): La deuxième dépendance a été supprimée de la documentation. Il devrait maintenant fonctionner avec cette dépendance seulement: compile 'com.firebase:firebase-jobdispatcher:0.5.2'.

+0

Merci beaucoup. Cela a fonctionné pour moi. :) –