android无法添加一个信号 [英] android can't add one singnal

查看:136
本文介绍了android无法添加一个信号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试向我的项目发出信号,并添加像这样的依赖项

I am trying to one signal to my project and i add dependencies like this

buildscript {
    repositories {
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.8.1'
    }
    }
    apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

    repositories {
      maven { url 'https://maven.google.com' }

}

以及在我的build.gradle

and in my build.gradle

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

allprojects {
    repositories {
        jcenter()
        maven { url 'http://jhoobin.abroid.com/repo/' }
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
        google()
    }

}

但是当我同步gradle时我总是出错

but i keep getting error when i sync the gradle

错误:无法解决':app @ debug/compileClasspath'的依赖关系:找不到与com.google.android.gms:play-services:15. +匹配的任何版本. 打开文件
显示详细信息

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not find any version that matches com.google.android.gms:play-services:15.+. Open File
Show Details

我的代码有什么问题?

推荐答案

这些是我的毕业证书. 这是我的:app gradle

These are my gradles. This is my :app gradle

//noinspection GradleCompatible
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.app.app"
        manifestPlaceholders = [onesignal_app_id: "APP_ID_HERE",
                                // Project number pulled from dashboard, local value is ignored.
                                onesignal_google_project_number: "PROJECT_NUMBER_HERE"]
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/commons-io-2.4.jar')
    compile 'com.google.firebase:firebase-core:10.2.0'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.onesignal:OneSignal:3.+@aar'
    // Required for OneSignal, even if you have added FCM.
    compile 'com.google.android.gms:play-services-gcm:10.2.0'
    testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

我的主要项目很成功

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

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.0.0'

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

allprojects {
    repositories {
        jcenter()
    }
}

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

这篇关于android无法添加一个信号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆