NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 196 forks source link

The order of repositories causes a compilation issue on nativescript-google-maps-sdk #3676

Closed isaacfi closed 6 years ago

isaacfi commented 6 years ago
https://github.com/NativeScript/nativescript-cli/blob/c18a8189ccb9ba33d04e3829edd322a0fbc1f6b5/vendor/gradle-plugin/build.gradle#L20

Error: Command ./gradlew failed with exit code 1 Error output:

FAILURE: Build failed with an exception.

What went wrong:
Could not resolve all files for configuration ':releaseCompileClasspath'.
Could not find common.jar (android.arch.core:common:1.0.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/core/common/1.0.0/common-1.0.0.jar

The order has to be changed as @jibon57 suggested in the issue 1081: Problem building nativescript-google-maps-sdk on Android

NickIliev commented 6 years ago

@isaacfi please post the content of the package.json file.

isaacfi commented 6 years ago
{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.myapp",
    "tns-android": {
      "version": "4.1.2"
    },
    "tns-ios": {
      "version": "4.1.0"
    }
  },
  "dependencies": {
    "@angular/animations": "~6.0.0",
    "@angular/common": "~6.0.0",
    "@angular/compiler": "~6.0.0",
    "@angular/core": "~6.0.0",
    "@angular/forms": "~6.0.0",
    "@angular/http": "~6.0.0",
    "@angular/platform-browser": "~6.0.0",
    "@angular/platform-browser-dynamic": "~6.0.0",
    "@angular/router": "~6.0.0",
    "@types/lodash": "^4.14.88",
    "angular2-uuid": "^1.1.1",
    "lodash": "^4.17.4",
    "moment": "^2.18.1",
    "nativescript-angular": "^6.0.0",
    "nativescript-appavailability": "^1.3.1",
    "nativescript-barcodescanner": "^2.7.6",
    "nativescript-bluetooth": "^1.3.0",
    "nativescript-camera": "^3.2.1",
    "nativescript-cardview": "^3.0.1",
    "nativescript-checkbox": "^3.0.3",
    "nativescript-contacts": "^1.5.4",
    "nativescript-couchbaselite": "^1.0.11",
    "nativescript-drop-down": "^3.2.4",
    "nativescript-enumerable": "^3.5.2",
    "nativescript-geolocation": "3.0.1",
    "nativescript-google-maps-sdk": "^2.6.0",
    "nativescript-imagecropper": "1.0.1",
    "nativescript-loading-indicator": "^2.4.0",
    "nativescript-local-notifications": "^2.0.3",
    "nativescript-modal-datetimepicker": "^1.0.3",
    "nativescript-ngx-fonticon": "^4.0.0",
    "nativescript-permissions": "^1.2.3",
    "nativescript-phone": "^1.3.1",
    "nativescript-platform-css": "^1.6.5",
    "nativescript-plugin-firebase": "5.1.8",
    "nativescript-swift-3.0": "^1.0.0",
    "nativescript-telephony": "^1.0.4",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-toast": "^1.4.6",
    "nativescript-ui-chart": "^3.6.1",
    "nativescript-ui-listview": "^3.5.7",
    "nativescript-ui-sidedrawer": "^4.1.1",
    "reflect-metadata": "^0.1.10",
    "rxjs": "^6.0.0",
    "rxjs-compat": "^6.0.0",
    "tns-core-modules": "^4.1.0",
    "zone.js": "^0.8.18"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~6.0.0",
    "@ngtools/webpack": "~1.8.2",
    "babel-traverse": "6.24.1",
    "babel-types": "6.24.1",
    "babylon": "6.17.0",
    "chai": "^3.5.0",
    "codelyzer": "^4.0.0",
    "copy-webpack-plugin": "~4.3.0",
    "css-loader": "~0.28.7",
    "extract-text-webpack-plugin": "~3.0.2",
    "filewalker": "0.1.3",
    "karma": "^1.6.0",
    "karma-chai": "^0.1.0",
    "karma-mocha": "^1.3.0",
    "karma-nativescript-launcher": "^0.4.0",
    "lazy": "1.0.11",
    "mocha": "^3.3.0",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-custom-entitlements": "^0.2.0",
    "nativescript-dev-typescript": "^0.6.0",
    "nativescript-dev-webpack": "^0.9.1",
    "nativescript-worker-loader": "~0.8.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.2.1",
    "tns-platform-declarations": "^4.0.0",
    "tslib": "1.7.1",
    "tslint": "^5.1.0",
    "typescript": "~2.7.2",
    "uglifyjs-webpack-plugin": "~1.1.6",
    "webpack": "~3.10.0",
    "webpack-bundle-analyzer": "^2.9.1",
    "webpack-sources": "~1.1.0"
  }
}

This issue is in nativescript/cli@4.1.0

$tns --version 4.1.0

NickIliev commented 6 years ago

@isaacfi I've tried to reproduce the issue using the same package.json with this test project, but on my side, everything is working as expected. However, I've noticed in the link you have provided (jibon57 solution) that the issue seems to be resolved by changing the gradle repositories order in the global build. gradle (basically by moving jcenter() to the bottom). This could be related to the fact that there were some issues with downloading from jcenter recently but it seems that the issue it resolved now even without changing the repositories order.

Of course the above is just a theory as I am not able to reproduce it on my side - Please do let me know if there is another specific that can be applied to reproduce the issue.

isaacfi commented 6 years ago

@NickIliev you were right, it seems that was a problem with jcenter() you can close this issue.

Regards.