roblav96 / nativescript-onesignal

A Nativescript plugin that wraps the iOS and Android OneSignal Push Notifications SDK.
https://documentation.onesignal.com/docs/getting-started
Other
24 stars 42 forks source link

Build Failed #40

Closed mahavirvataliya closed 6 years ago

mahavirvataliya commented 6 years ago

Build file 'mobile-app/platforms/android/build.gradle' line: 9

  • What went wrong: A problem occurred evaluating root project 'cloint'.

    Could not find method maven() for arguments [build_4fm12iry20mhqjbe9e2xnugtm$_run_closure1$_closure3@8753f85] on object of type org.gradle.api.internal.initialization.DefaultScriptHandler.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s Unable to apply changes on device: emulator-5554. Error is: Command ./gradlew failed with exit code 1. Executing after-watch hook from mobile-app/hooks/after-watch/nativescript-dev-typescript.js Stopping tsc watch

mobile-app/platforms/android/build.gradle

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

buildscript {

    repositories {
        google()
        jcenter()
    }

>         maven { url "https://plugins.gradle.org/m2/" }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath "gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.10.1, 0.99.99]"
 }
}

allprojects {
    repositories {
        google()
        jcenter()
    }

    maven { url "https://plugins.gradle.org/m2/" }
}

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

Above Error Occured in Addition to project

mahavirvataliya commented 6 years ago

app.gradle


// Add your native dependencies here:

// Uncomment to add recyclerview-v7 dependency
//dependencies {
//  compile 'com.android.support:recyclerview-v7:+'
//}

android {  
  defaultConfig {  
    generatedDensities = []
    applicationId = "org.nativescript.cloint"

    manifestPlaceholders = [
            manifestApplicationId: "${applicationId}",
            onesignal_app_id: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",  // I have Created And added App id here
            onesignal_google_project_number: "REMOTE"
        ] 

    //override supported platforms
    // ndk {
    //       abiFilters.clear()
    //          abiFilters "armeabi-v7a"
        // }

  }  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }  
} 

def settingsGradlePath

if(project.hasProperty("appResourcesPath")){
    settingsGradlePath = "$project.appResourcesPath/Android/settings.gradle";
} else {
    settingsGradlePath = "$rootDir/../../app/App_Resources/Android/settings.gradle";
}

def settingsGradleFile = new File(settingsGradlePath);

if(settingsGradleFile.exists())
{
    apply from: settingsGradleFile;
}
jkasten2 commented 6 years ago

@mahavirvataliya Closing this issue as a duplicate of #38. I have added something you can try to resolve this issue there. If you give it a try let us know if it works

markosole commented 5 years ago

Hi guys, is there any solution for this? I am getting same error on NS 5.2.2 Installed plugin using tns plugin add nativescript-onesignal image

Thanks!

CapellaBlue commented 5 years ago

FWIW, I was able to move the maven inside repositories to get past this.

repositories {
        google()
        jcenter()
        maven { url "https://plugins.gradle.org/m2/" }
    }