0

Today, I created a new project, installed some plugins and tap on "Run" in NativeScript Sidekick, to build my app on cloud to my Android device, but I faced this error:

[00:01:35.796] [WARN]   Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
    is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
    Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:8:5-18:19 to override.
FAILURE: Build failed with an exception.

Some said that NativeScript Sidekick and NativeScript Cloud build are not yet compatible with NativeScript 6

I have been navigating for hours and reading similar issues on GitHub and Stack Overflow, but none of them worked for me, or for Cloud build.

This is my package.json content:

{
  "nativescript": {
    "id": "com.app.test",
    "tns-android": {
      "version": "5.4.0"
    },
    "tns-ios": {
      "version": "5.4.2"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "nativescript-geolocation": "5.1.0",
    "nativescript-mapbox": "4.4.1",
    "nativescript-plugin-firebase": "9.0.3",
    "nativescript-theme-core": "1.0.6",
    "nativescript-ui-autocomplete": "5.0.0",
    "nativescript-ui-dataform": "5.0.0",
    "nativescript-ui-listview": "7.0.1",
    "nativescript-ui-sidedrawer": "7.0.0",
    "nativescript-webrtc-plugin": "2.0.0-alpha.18",
    "tns-core-modules": "5.4.3"
  },
  "devDependencies": {
    "nativescript-dev-typescript": "~0.10.0",
    "nativescript-dev-webpack": "~0.24.0"
  },
  "gitHead": "**************",
  "readme": "NativeScript Application",
  "author": "***"
}

Edit

I am not using NS 6, I use NS 5, since Sidekick is not yet compatible with NS 6. Also, I removed UI Pro components plugins, and it seems to work now. The pro UI plugins might work if I use older versions.

halfer
  • 19,824
  • 17
  • 99
  • 186
plain.js
  • 64
  • 1
  • 6
  • Please note that [religious material is removed here](https://meta.stackoverflow.com/questions/295810/do-we-allow-religious-invocations-in-questions-answers), just as we do politics and other off-topic conversation. Let's keep it to programming, please. – halfer Jul 25 '19 at 07:27

1 Answers1

2

I'm not sure the compatibility of SideKick/Cloud build and 6.0/AndroidX, that normally lags a couple weeks. However I can tell you based on your package file, that it won't work. You are mixing Android & AndroidX :)

NativeScript requires NS 6.0 runtimes for AndroidX. NS 5.4 DOES not use AndroidX. But you are using NS-UI versions which are AndroidX.

So to test if sidekick/cloud builds supports AndroidX I would make the following changes:

{
  "nativescript": {
    "id": "com.app.test",
    "tns-android": {
      "version": "5.4.0"
    },
    "tns-ios": {
      "version": "5.4.2"
    }
  },

Needs to be changed to

{
  "nativescript": {
    "id": "com.app.test",
    "tns-android": {
      "version": "6.0.0"
    },
    "tns-ios": {
      "version": "6.0.1"
    }
  },

In addition this needs to be changed:

"devDependencies": {
    "nativescript-dev-typescript": "~0.10.0",
    "nativescript-dev-webpack": "~0.24.0"
  },

to

"devDependencies": {
    "nativescript-dev-webpack": "~1.0.1"
  },

And finally this: "tns-core-modules": "5.4.3" needs to be "tns-core-modules": "~6.0.1"

As for the rest of the dependencies; that is hard to say; because NativeScript just transitioned to AndroidX; their is a good change that some of the other plugins you have listed; might not be AndroidX compatible. I would honestly try building an app with out any of the extra plugins first:

"dependencies": {
    "nativescript-theme-core": "1.0.6",
    "tns-core-modules": "~6.0.0"
  }, 
Nathanael
  • 5,369
  • 18
  • 23