Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack error on Android with plugin added #2760

Closed
hypery2k opened this issue Sep 19, 2016 · 12 comments
Closed

Webpack error on Android with plugin added #2760

hypery2k opened this issue Sep 19, 2016 · 12 comments

Comments

@hypery2k
Copy link

I'm facing issues when adding the drawing-pad plugin in combination with the webpack build. I'm always getting the following error:

09-19 12:44:06.025 19533 19533 E AndroidRuntime: TypeError: Cannot read property 'gcacace' of undefined
09-19 12:44:06.025 19533 19533 E AndroidRuntime: File: "/data/data/de.sample.app/files/app/bundle.js, line: 95825, column: 30

Any ideas?

I check a similar issue, but it didn't helped

@hypery2k
Copy link
Author

it seems to be related to ABIs split

@hypery2k
Copy link
Author

If I add manually the dependency in my app.gradle it works:

dependencies {
  compile "com.github.gcacace:signature-pad:1.0.3"
}

Seems to be somekind of merge error with dependencies in app.gradle

@NickIliev
Copy link
Contributor

ping @slavchev , @Pip3r4o

@petekanev petekanev self-assigned this Sep 19, 2016
@petekanev
Copy link
Contributor

petekanev commented Sep 19, 2016

The NS plugin in question wraps a native (Android) plugin, and leverages NS's power to access native API. We expose metadata for all native API that is referenced in the project (some of which is used in the drawing pad plugin), and for whatever reason the native plugin isn't downloaded in the first place. I will check it out

@jlooper
Copy link

jlooper commented Sep 19, 2016

Watching this one, and ping @NathanWalker

@petekanev
Copy link
Contributor

petekanev commented Sep 20, 2016

@hypery2k could you try removing the platforms/android dir and building the app again? The plugin should have its dependency declared already in configurations/nativescript-drawingpad/include.gradle and thus should not require that any additional work be done to make it function

@hypery2k
Copy link
Author

I always doing this ;) But it doesn't help

@hypery2k
Copy link
Author

the issue seems to be coming from using es6 in the tsconfig:

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "noEmitHelpers": true,
    "noEmitOnError": true
  },
  "compileOnSave": true,
  "filesGlob": [
    "./app/**/*.ts",
    "./references.d.ts"
  ],
  "exclude": [
    "node_modules",
    "platforms"
  ]
}

If I'm using es5 it's working. But seems a little bit strange to me. I can also use es6 if I adopt my references.d:

/// <reference path="./node_modules/tns-core-modules/tns-core-modules.es6.d.ts" /> Needed for autocompletion and compilation.
/// <reference path="./nativescript-permissions"/>
/// <reference path="./node_modules/nativescript-appinfo/appinfo"/>
/// <reference path="./node_modules/nativescript-drawingpad/index"/>
/// <reference path="./node_modules/@nextrust/angular-common/nextrust.d.ts"/>

interface Thenable<R> {
  then<U>(onFulfilled?: (value: R) => Thenable<U>, onRejected?: (error: any) => Thenable<U>): Thenable<U>;
  then<U>(onFulfilled?: (value: R) => Thenable<U>, onRejected?: (error: any) => U): Thenable<U>;
  then<U>(onFulfilled?: (value: R) => Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
  then<U>(onFulfilled?: (value: R) => U, onRejected?: (error: any) => Thenable<U>): Thenable<U>;
  then<U>(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable<U>;
  then<U>(onFulfilled?: (value: R) => U, onRejected?: (error: any) => void): Thenable<U>;
}

Can't I use ES6 normally with NativeScript? Not sure if this related to library error

@petekanev
Copy link
Contributor

@hypery2k The android runtime will bring ES6 support in the upcoming (2.4) release with the update of the javascript (v8) engine. I don't however understand yet how that is causing the problems in question.

@hypery2k
Copy link
Author

good to know. For us it's currently working with the gradle and tsconfig hacks.
Did you have a timeline for 2.4?

@tsonevn tsonevn added this to the 2.6.0 (TBD) milestone Dec 5, 2016
@hshristov hshristov modified the milestones: 2.5.0, 2.6.0 (TBD) Dec 5, 2016
@hshristov hshristov modified the milestones: 2.6.0 (TBD), 2.5.0 Jan 4, 2017
@petekanev petekanev removed their assignment Feb 16, 2017
@vchimev vchimev self-assigned this May 1, 2017
@vchimev vchimev removed this from the 3.0 milestone May 1, 2017
@vchimev vchimev removed their assignment May 1, 2017
@NickIliev
Copy link
Contributor

@hypery2k the issue is resolved with NativeScript 3.4.0 and higher version.
I have tested with next (4.0.0) with this demo application which is using the mentioned plugin and bundling with WebPack is working as expected.

Notice that I still had to add the nativescript-drawingpad to vendor.ts

global.registerModule("nativescript-drawingpad", ()=> require('../node_modules/nativescript-drawingpad'))

@NickIliev NickIliev added done ready for test TSC needs to test this and confirm against live production apps and automated test suites labels Feb 19, 2018
@NickIliev NickIliev added this to the 4.0 milestone Feb 19, 2018
@vakrilov vakrilov removed the ready for test TSC needs to test this and confirm against live production apps and automated test suites label Feb 20, 2018
@vakrilov vakrilov modified the milestones: 4.0, 3.4 Feb 20, 2018
@ghost ghost removed the bug label Feb 20, 2018
@lock
Copy link

lock bot commented Aug 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants