首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >找不到firebase-messaging.jar - Android构建错误

找不到firebase-messaging.jar - Android构建错误
EN

Stack Overflow用户
提问于 2018-06-09 13:41:14
回答 1查看 808关注 0票数 2

我得到了这个构建错误。

找不到firebase-messaging.jar (com.google.firebase:firebase-messaging:15.0.2).已在以下位置搜索:https://jcenter.bintray.com/com/google/firebase/firebase-messaging/15.0.2/firebase-messaging-15.0.2.jar

我已经附上了下面的build.gradle代码。请查收。我无法在stackoverflow上获得解决方案

build.gradle

plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    //buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.test.android"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 3
        versionName "1.0.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
        manifestPlaceholders = [onesignal_app_id : "65f11821-XXXXXX-4ec4-9e41-XXXXXXXX",
                                // Project number pulled from dashboard, local value is ignored.
                                onesignal_google_project_number: "XXXXX"]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    // applovin
    implementation project(':unity-ads')
    //unity ads
    //compile 'com.google.android.gms:play-services-ads:11.0.4'
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:support-vector-drawable:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.1'
    implementation 'com.android.support:support-v4:26.1.0'
    //implementation 'com.google.android.gms:play-services:11.6.0'
    implementation 'com.android.support:multidex:1.0.3'
    //compile 'com.github.cooltechworks:ScratchView:v1.1'//not used
    implementation 'com.jackpocket:scratchoff:1.1.0'
    implementation 'com.adcolony:sdk:3.2.1'
    implementation 'com.android.support:support-annotations:27.1.1'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.facebook.android:facebook-share:4.33.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.ironsource.sdk:mediationsdk:6.7.0.1@jar'
    //compile 'com.google.ads.mediation:unity:2.1.1.0' //not used
    //implementation 'com.google.firebase:firebase-database:11.6.0'
    implementation 'com.github.bumptech.glide:glide:4.1.1'
    //implementation 'commons-net:commons-net:3.3'
    //get server time
    //compile 'com.github.instacart.truetime-android:library-extension-rx:2.0'
    //compile 'com.github.instacart.truetime-android:library:2.0' // not used
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    //implementation 'com.google.firebase:firebase-auth:11.6.0'
    //implementation 'com.google.firebase:firebase-core:11.6.0'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    //implementation 'com.onesignal:OneSignal:[3.7.1, 3.9.1]'
    implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
    implementation files('libs/applovin-sdk-7.7.0-javadoc.jar')
    implementation files('libs/applovin-sdk-7.7.0.jar')
}
apply plugin: 'com.google.gms.google-services'

项目build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url "https://maven.google.com"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0-alpha17'
        classpath 'com.google.gms:google-services:4.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
        maven { url "https://adcolony.bintray.com/AdColony" }
        maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
        google()
    }
}

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

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-10 04:13:31

在build.gradle文件中,将google()移到jcenter()之上对我来说很有效

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0-alpha17'
        classpath 'com.google.gms:google-services:4.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        //maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
        maven { url "https://adcolony.bintray.com/AdColony" }
        maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50771269

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档