abhayastudios / nativescript-contacts-lite

This nativescript-contacts-lite plugin provides pretty fast read-only access to the iOS and Android contact directory.
MIT License
13 stars 7 forks source link

Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository() #14

Open dpdragnev opened 4 years ago

dpdragnev commented 4 years ago

Hello,

I am trying to build my app on a Mac for Android and I am getting the following error:

A problem occurred evaluating root project 'nativescript_contacts_lite'.
> Failed to apply plugin [class 'org.gradle.api.plugins.BasePlugin']
   > Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().

Here is my package.json:

{
  "nativescript": {
    "id": "io.app.company",
    "tns-ios": {
      "version": "6.5.3"
    },
    "tns-android": {
      "version": "6.5.3"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@nativescript/theme": "~2.3.0",
    "@nstudio/nativescript-camera-plus": "3.0.7",
    "@nstudio/nativescript-loading-indicator": "3.0.2",
    "moment": "^2.26.0",
    "nativescript-appversion": "1.4.4",
    "nativescript-carousel": "^6.1.1",
    "nativescript-contacts-lite": "0.2.7",
    "nativescript-custom-bottomsheet": "^1.0.6",
    "nativescript-imagecropper": "^3.0.0",
    "nativescript-iqkeyboardmanager": "^1.5.1",
    "nativescript-masked-text-field": "4.0.3",
    "nativescript-permissions": "1.3.8",
    "nativescript-plugin-firebase": "10.5.0",
    "nativescript-ui-listview": "^8.1.2",
    "tns-core-modules": "~6.4.0"
  },
  "devDependencies": {
    "nativescript-dev-webpack": "1.5.1",
    "tns-platform-declarations": "6.5.15",
    "typescript": "~3.5.3"
  },
  "gitHead": "",
  "readme": "NativeScript Application"
}

Any idea what could be causing this?

Thank you

abhayastudios commented 4 years ago

Hi @dpdragnev! Hard to tell to be honest without the project itself, but first thing I would try is to see if you can build the demo project (demo-ng). If that works then it is likely something with your project.

If you can provide a repo to your project I wouldnt mind to have a look. Also I am wondering why the output above references nativescript_contacts_lite with underscores instead of dashes, or is that what you named your project?

dpdragnev commented 4 years ago

@abhayastudios This is a good question. I copied the error message directly from the console window. My project is called something completely different.

I will try your suggestion to build the demo project and will report back a little later today.

dpdragnev commented 4 years ago

This is so weird. I cannot figure out where the nativescript_contacts_lite is coming from. This is the whole error:

* What went wrong:
A problem occurred evaluating root project 'nativescript_contacts_lite'.
> Failed to apply plugin [class 'org.gradle.api.plugins.BasePlugin']
   > Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().

* 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 1m 5s
Failed to build plugin nativescript-contacts-lite : 
Error: Command ./gradlew failed with exit code 1
dpdragnev commented 4 years ago

@abhayastudios So I cloned the repo and tried to run the anglular demo and I got the exact same error. See the attached screenshot.

Screen Shot 2020-11-18 at 4 40 13 PM

If I run tns doctor I get all green checkmarks, so I don't think it is something in my system.

I would appreciate it if you could take a look and suggest a fix.

Thanks.

abhayastudios commented 4 years ago

Hmm weird, I tried to build the demo project just now on my Mac still using NS 6.5 and it works just fine.

Can you send me the output of your $ tns info? Also, what command are you using to build?

dpdragnev commented 4 years ago

@abhayastudios Here is the tns info:

✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 6.5.0 and the latest available version is 7.0.11.
⚠ Update available for component tns-core-modules. Your current version is 6.4.2 and the latest available version is 6.5.21.
✔ Component tns-android has 6.5.3 version and is up to date.
✔ Component tns-ios has 6.5.3 version and is up to date.

I am using tns build android to build the project

Let me try updating the tns-core-modules. Maybe this is the issue

dpdragnev commented 4 years ago

After updating the tns-core-modules. I get this error (same error, but gives a little more info)

* Where:
Build file '/Volumes/T7/Documents/Projects/nativescript-contacts-lite/demo-angular/platforms/tempPlugin/nativescript_contacts_lite/build.gradle' line: 28

* What went wrong:
A problem occurred evaluating root project 'nativescript_contacts_lite'.
> Failed to apply plugin [class 'org.gradle.api.plugins.BasePlugin']
   > Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().

* 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 1m 1s
Failed to build plugin nativescript-contacts-lite : 
Error: Command ./gradlew failed with exit code 1
Daniels-MacBook-Pro:demo-angular daniel$ 

It looks like it does not like line 28 in build.gradle, which is:

apply plugin: 'com.android.library'

I don't know if this helps

abhayastudios commented 4 years ago

Still builds fine for me both with nativescript 6.5 and 7.0. Looks unrelated to ./platforms/tempPlugin/nativescript_contacts_lite since I see that on my side as well and it is working fine.

After Googling a little bit it seems it might be related to a bug in Gradle, see this Flutter issue and this Gradle issue, so maybe this might work?

If not, can you run with the --stacktrace or --debug option so maybe it will output some more useful info?