Unable to run on device - Unable to apply changes on device: 016ed1f408cc6b45. Error is: TypeScript compiler failed with exit code 1.
Closed this issue · 3 comments
Receiving the following errors when trying to run on Android:
Searching for devices...
Your application will be deployed only on the device specified by the provided i ndex or identifier.
Executing before-liveSync hook from C:\app\nativescript-maps-app\hooks\before-li veSync\nativescript-angular-sync.js
Executing before-prepare hook from C:\app\nativescript-maps-app\hooks\before-pre pare\nativescript-dev-typescript.js
Found peer TypeScript 2.4.2
node_modules/nativescript-angular/node_modules/rxjs/Subject.d.ts(16,22): error T S2415: Class 'Subject<T>' incorrectly extends base class 'Observable<T>'.
Types of property 'lift' are incompatible.
Type '<T, R>(operator: Operator<T, R>) => Observable<T>' is not assignable t o type '<R>(operator: Operator<T, R>) => Observable<R>'.
Type 'Observable<T>' is not assignable to type 'Observable<R>'.
Type 'T' is not assignable to type 'R'.
node_modules/nativescript-angular/node_modules/rxjs/observable/dom/WebSocketSubj ect.d.ts(23,22): error TS2415: Class 'WebSocketSubject<T>' incorrectly extends b ase class 'AnonymousSubject<T>'.
Types of property 'lift' are incompatible.
Type '<R>(operator: Operator<T, R>) => WebSocketSubject<R>' is not assignabl e to type '<T, R>(operator: Operator<T, R>) => Observable<T>'.
Type 'WebSocketSubject<R>' is not assignable to type 'Observable<T>'.
Types of property 'operator' are incompatible.
Type 'Operator<any, R>' is not assignable to type 'Operator<any, T>'.
Type 'R' is not assignable to type 'T'.
node_modules/tns-core-modules/declarations.d.ts(3,15): error TS2300: Duplicate i dentifier 'Request'.
node_modules/tns-core-modules/declarations.d.ts(17,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'headers' must be of ty pe 'any', but here has type 'string[] | Headers | { [index: string]: string; }'.
node_modules/tns-core-modules/declarations.d.ts(32,14): error TS2300: Duplicate identifier 'RequestMode'.
node_modules/tns-core-modules/declarations.d.ts(33,14): error TS2300: Duplicate identifier 'RequestCredentials'.
node_modules/tns-core-modules/declarations.d.ts(34,14): error TS2300: Duplicate identifier 'RequestCache'.
node_modules/tns-core-modules/declarations.d.ts(36,15): error TS2300: Duplicate identifier 'Headers'.
node_modules/tns-core-modules/declarations.d.ts(46,5): error TS2687: All declara tions of 'bodyUsed' must have identical modifiers.
node_modules/tns-core-modules/declarations.d.ts(56,15): error TS2300: Duplicate identifier 'Response'.
node_modules/tns-core-modules/declarations.d.ts(69,14): error TS2300: Duplicate identifier 'ResponseType'.
node_modules/tns-core-modules/declarations.d.ts(72,5): error TS2687: All declara tions of 'status' must have identical modifiers.
node_modules/tns-core-modules/declarations.d.ts(73,5): error TS2687: All declara tions of 'statusText' must have identical modifiers.
node_modules/tns-core-modules/declarations.d.ts(74,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'headers' must be of ty pe 'any', but here has type 'HeaderInit'.
node_modules/tns-core-modules/declarations.d.ts(74,5): error TS2687: All declara tions of 'headers' must have identical modifiers.
node_modules/tns-core-modules/declarations.d.ts(78,14): error TS2300: Duplicate identifier 'BodyInit'.
node_modules/tns-core-modules/declarations.d.ts(79,14): error TS2300: Duplicate identifier 'RequestInfo'.
node_modules/typescript/lib/lib.d.ts(7960,11): error TS2300: Duplicate identifie r 'Headers'.
node_modules/typescript/lib/lib.d.ts(7969,13): error TS2300: Duplicate identifie r 'Headers'.
node_modules/typescript/lib/lib.d.ts(13115,11): error TS2300: Duplicate identifi er 'Request'.
node_modules/typescript/lib/lib.d.ts(13132,13): error TS2300: Duplicate identifi er 'Request'.
node_modules/typescript/lib/lib.d.ts(13137,11): error TS2300: Duplicate identifi er 'Response'.
node_modules/typescript/lib/lib.d.ts(13148,13): error TS2300: Duplicate identifi er 'Response'.
node_modules/typescript/lib/lib.d.ts(18756,6): error TS2300: Duplicate identifie r 'BodyInit'.
node_modules/typescript/lib/lib.d.ts(18787,6): error TS2300: Duplicate identifie r 'RequestInfo'.
node_modules/typescript/lib/lib.d.ts(18836,6): error TS2300: Duplicate identifie r 'RequestCache'.
node_modules/typescript/lib/lib.d.ts(18837,6): error TS2300: Duplicate identifie r 'RequestCredentials'.
node_modules/typescript/lib/lib.d.ts(18839,6): error TS2300: Duplicate identifie r 'RequestMode'.
node_modules/typescript/lib/lib.d.ts(18842,6): error TS2300: Duplicate identifie r 'ResponseType'.
Unable to apply changes on device: 016ed1f408cc6b45. Error is: TypeScript compil er failed with exit code 1.
It looks like you have some issues with your type definitions. Can you try changing "noEmitOnError": true
to "noEmitOnError": false
in your tsconfig.json
file and try again?
I would like to add onto this since I had the same issue. Doing as you suggest gets me the following error:
Execution failed for task ':mergeF0F1F2F3DebugResources'.
C:\Users\Nick\Documents\Mobile\nativescript-maps-app-master\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\11.0.4\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png: Error: File path too long on Windows, keep below 240 characters : C:\Users\Nick\Documents\Mobile\nativescript-maps-app-master\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\11.0.4\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png
This is probably the issue- I changed the location of my file path so it was shorter (It just barely passed 240 characters as is) and it managed to build fine.
@NickSterckx777 Glad that worked for you.
And yes - unfortunately Windows has issues with long file paths but that is one of the easiest ways to get around it.