Android Studio无法使用onesignal进行编译

问题描述

我正在尝试使用cordova在androidstudio中使用onesignal向我的应用添加推送通知,但是当我将onesignal添加到我的应用中并且即使我放置了“ apply插件:'com.android.application androidstudio询问的我的onesignal插件下的“”和我看到的一些答案。 我收到错误消息:

Could not get unkNown property 'android' for project ':app' of type org.gradle.api.Project.

我看到该错误是因为onesignal的应用不在app / build.gradle中,但这不是我的情况。这是我的app / build.gradle

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
    }
}

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
    repositories {
        mavenCentral()
        jcenter()
    }
}

task wrapper(type: Wrapper) {
    gradLeversion = '4.10.3'
}

ext {
    apply from: '../Cordovalib/cordova.gradle'

    // The value for android.compileSdkVersion.
    if (!project.hasProperty('cdvCompileSdkVersion')) {
        cdvCompileSdkVersion = null;
    }
    // The value for android.buildToolsversion.
    if (!project.hasProperty('cdvBuildToolsversion')) {
        cdvBuildToolsversion = null;
    }
    // Sets the versionCode to the given value.
    if (!project.hasProperty('cdvVersionCode')) {
        cdvVersionCode = null
    }
    // Sets the minSdkVersion to the given value.
    if (!project.hasProperty('cdvMinSdkVersion')) {
        cdvMinSdkVersion = null
    }
    // Sets the maxsdkVersion to the given value.
    if (!project.hasProperty('cdvMaxsdkVersion')) {
        cdvMaxsdkVersion = null
    }
    // The value for android.targetSdkVersion.
    if (!project.hasProperty('cdvTargetSdkVersion')) {
        cdvTargetSdkVersion = null;
    }
    // Whether to build architecture-specific APKs.
    if (!project.hasProperty('cdvBuildMultipleApks')) {
        cdvBuildMultipleApks = null
    }
    // Whether to append a 0 "abi digit" to versionCode when only a single APK is build
    if (!project.hasProperty('cdvVersionCodeForceAbiDigit')) {
        cdvVersionCodeForceAbiDigit = null
    }
    // .properties files to use for release signing.
    if (!project.hasProperty('cdvReleaseSigningPropertiesFile')) {
        cdvReleaseSigningPropertiesFile = null
    }
    // .properties files to use for debug signing.
    if (!project.hasProperty('cdvDebugSigningPropertiesFile')) {
        cdvDebugSigningPropertiesFile = null
    }
    // Set by build.js script.
    if (!project.hasProperty('cdvBuildArch')) {
        cdvBuildArch = null
    }

    // Plugin gradle extensions can append to this to have code run at the end.
    cdvPluginPostBuildExtras = []
}

// PLUGIN GRADLE EXTENSIONS START
apply from: "../cordova-plugin-firebasex/myapp-build.gradle"
apply from: "../onesignal-cordova-plugin/myapp2021-build-extras-onesignal.gradle"
// PLUGIN GRADLE EXTENSIONS END

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

有人可以告诉我如何解决错误吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)