PeterStaev / NativeScript-Drop-Down

A NativeScript DropDown widget.
Apache License 2.0
105 stars 65 forks source link

Getting error while running app in android. #81

Closed ghost closed 7 years ago

ghost commented 7 years ago

@PeterStaev Its working fine for me but getting error while installing and running app every time and also at livesync time giving error.

node_modules/nativescript-drop-down/drop-down.d.ts(40,14): error TS2304: Cannot find name 'UILabel'.

node_modules/nativescript-drop-down/drop-down.d.ts(41,18): error TS2503: Cannot find namespace 'android'.

Any idea about these??

PeterStaev commented 7 years ago

The Search function is your fried 😉 Take a look at https://github.com/PeterStaev/NativeScript-Drop-Down/issues/39#issuecomment-252548468

AbdallahBedir commented 7 years ago

@PeterStaev import { ios , android } from 'tns-platform-declarations'; I added this line in app.module but there are an error saying "cannot find tns-platform-declarations" so how can I add references for the android17.d.ts and ios.d.ts files in my project?

PeterStaev commented 7 years ago

@AbdallahBedir , that's not what the comment says to do 😄 You need to npm install tns-platform-declarations and then add /// <reference path"...." /> to your references file. The path is different depending on the {N} version you use, but you can see an example here: https://github.com/PeterStaev/NativeScript-Drop-Down/blob/master/references.d.ts#L10

ghost commented 7 years ago

Hi @PeterStaev I have installed tns-platform-declarations and then added /// // /

But still getting error.

AbdallahBedir commented 7 years ago

I have installed tns-platform-declarations and added /// <reference path="node_modules/tns-platform-declarations/android.d.ts" /> /// <reference path="node_modules/tns-platform-declarations/ios.d.ts" /> in my references.d.ts and had a new error says `node_modules/tns-platform-declarations/ios/objc-i386/objc!CoreAudio.d.ts(7,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'AudioBuffer' must be of type '{ new (): AudioBuffer; prototype: AudioBuffer; }', but here has type 'StructType'.

node_modules/tns-platform-declarations/ios/objc-i386/objc!UIKit.d.ts(4954,15): error TS2300: Duplicate identifier 'UIEvent'.

node_modules/tns-platform-declarations/ios/objc-i386/objc!UIKit.d.ts(4954,15): error TS2417: Class static side 'typeof UIEvent' incorrectly extends base class static side 'typeof NSObject'. Types of property 'alloc' are incompatible. Type '() => UIEvent' is not assignable to type '() => NSObject'. Type 'UIEvent' is not assignable to type 'NSObject'. Property 'accessibilityActivationPoint' is missing in type 'UIEvent'.

node_modules/typescript/lib/lib.d.ts(14991,11): error TS2300: Duplicate identifier 'UIEvent'.

node_modules/typescript/lib/lib.d.ts(14997,13): error TS2300: Duplicate identifier 'UIEvent'. `