NativeScript / push-plugin

Contains the source code for the Push Plugin.
Apache License 2.0
123 stars 45 forks source link

Can't compile fresh new project #173

Closed arielnmz closed 6 years ago

arielnmz commented 6 years ago

I don't know wether this is a gradle, nativescript or push-plugin issue but if you create a new project with:

tns create <project-name>

And then install the plugin with:

tns plugin add nativescript-push-plugin

then do tns platform add android and tns build android, the build will fail with the following message:

FAILURE: Build failed with an exception.

* Where:
Build file '/home/ariel/nstest/pushtest/platforms/android/build.gradle' line: 11

* What went wrong:
Could not compile build file '/home/ariel/nstest/pushtest/platforms/android/build.gradle'.
> startup failed:
  build file '/home/ariel/nstest/pushtest/platforms/android/build.gradle': 11: expecting anything but ''\n''; got it anyway @ line 11, column 51.
     roid.tools.build:gradle:2.3.3'
                                   ^

  1 error

The erroneous file looks like this:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.google.gms:google-services:3.1.1"
        classpath "com.android.tools.build:gradle:2.3.3'
    }
}

And of course changing that ' for a " works, as mentioned here #165 (comment), but then it fails with the following message:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'pushtest'.
> Configuration with name 'compile' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

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

But you can fix that too, as mentioned in this other comment on issue #170, however, it will fail again with this one:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processF0DebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it. 
   Searched Location: 
  /home/ariel/nstest/pushtest/platforms/android/app/src/F0/debug/google-services.json
  /home/ariel/nstest/pushtest/platforms/android/app/src/debug/F0/google-services.json
  /home/ariel/nstest/pushtest/platforms/android/app/src/F0/google-services.json
  /home/ariel/nstest/pushtest/platforms/android/app/src/debug/google-services.json
  /home/ariel/nstest/pushtest/platforms/android/app/src/F0Debug/google-services.json
  /home/ariel/nstest/pushtest/platforms/android/app/google-services.json

Despite google-services.json being correctly located in app/App_Resources/Android/

prabudevarrajan1 commented 6 years ago

Facing the same issue - works fine on tns-android 3.3.1 and not on 3.4.0

lini commented 6 years ago

This issue should be fixed in the latest release of the plugin - https://github.com/NativeScript/push-plugin/releases/tag/v0.3.0

dtopuzov commented 6 years ago

Close as duplicate of https://github.com/NativeScript/push-plugin/issues/165