nativescript-community / ui-lottie

NativeScript plugin to expose Airbnb Lottie
https://github.com/airbnb/lottie-android
Other
177 stars 57 forks source link

"lottie.ts is missing from the TypeScript compilation" error running samples #72

Closed JimLynchCodes closed 3 years ago

JimLynchCodes commented 3 years ago

Hi.

I was expecting to be able to clone this repo, navigate into the "demo-angular" folder, then run npm i and tns run ios to see a the app running on my machine.

When I do the run command though it gives me this error:

ERROR in /Users/jim/Forked-Git-Projects/nativescript-lottie/src/lottie.ts
Module build failed (from ../node_modules/@ngtools/webpack/src/index.js):
Error: /Users/jim/Forked-Git-Projects/nativescript-lottie/src/lottie.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at NativeScriptAngularCompilerPlugin.getCompiledFile (/Users/jim/Forked-Git-Projects/nativescript-lottie/demo-angular/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:949:23)
    at NativeScriptAngularCompilerPlugin.getCompiledFile (/Users/jim/Forked-Git-Projects/nativescript-lottie/demo-angular/node_modules/@nativescript/webpack/plugins/NativeScriptAngularCompilerPlugin.js:29:26)
    at /Users/jim/Forked-Git-Projects/nativescript-lottie/demo-angular/node_modules/@ngtools/webpack/src/loader.js:43:31
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
 @ ./app/home/home.component.ts 4:0-49 7:36-46
 @ ./app/app-routing.module.ts
 @ ./app/app.module.ts
 @ ./main.ts

I tried this on node v14.15.4 and v13.something

Am I doing something wrong here or missing an extra step? If so, would probably be nice to add a note in the README for how to run the example projects. Thanks!

JimLynchCodes commented 3 years ago

Interesting, when I try to navigate into the "demo" folder, run npm i, and then ns run ios it gives me this different error:

Webpack compilation complete. Watching for file changes.
Webpack build done!
Updating runtime package.json with configuration values...
Project successfully prepared (ios)
Building project...
Xcode build...
2021-02-16 17:30:20.330 xcodebuild[16868:268035]  DVTProvisioningProfileManager: Failed to load profile "/Users/jim/Library/MobileDevice/Provisioning Profiles/EnrolledAgentStudyApp_CertificateSigningRequest.certSigningRequest" (Error Domain=DVTProvisioningProfileSourceErrorDomain Code=0 "No provisioning profile provider found for profile "/Users/jim/Library/MobileDevice/Provisioning Profiles/EnrolledAgentStudyApp_CertificateSigningRequest.certSigningRequest"." UserInfo={NSLocalizedDescription=No provisioning profile provider found for profile "/Users/jim/Library/MobileDevice/Provisioning Profiles/EnrolledAgentStudyApp_CertificateSigningRequest.certSigningRequest".})
2021-02-16 17:30:20.330 xcodebuild[16868:268040]  DVTProvisioningProfileManager: Failed to load profile "/Users/jim/Library/MobileDevice/Provisioning Profiles/distribution.cer" (Error Domain=DVTProvisioningProfileSourceErrorDomain Code=0 "No provisioning profile provider found for profile "/Users/jim/Library/MobileDevice/Provisioning Profiles/distribution.cer"." UserInfo={NSLocalizedDescription=No provisioning profile provider found for profile "/Users/jim/Library/MobileDevice/Provisioning Profiles/distribution.cer".})
./.build_env_vars.sh: line 451: declare: UID: readonly variable
NSLD: Swift bridging header '*-Swift.h' not found under '/Users/jim/Library/Developer/Xcode/DerivedData/demo-cptvkxigkwvvxoexzjlxadicrkao/Build/Intermediates.noindex/demo.build/Debug-iphonesimulator/demo.build/Objects-normal/x86_64'
Generating metadata...~/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/internal/metadata-generator/bin ~/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios
Python version: 2.7.16 (default, Dec 13 2019, 18:00:32) 
[GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.32.4) (-macos10.15-objc-s
Generating metadata for x86_64
Metadata Generator Arguments: 
./objc-metadata-generator -verbose -output-bin /Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/metadata-x86_64.bin -output-umbrella /Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/umbrella-x86_64.h -docset-path /Users/jim/Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.iOS.docset Xclang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk -mios-simulator-version-min=9.0 -std=gnu99 -target x86_64-apple-ios13.0-macabi -I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/include -I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization/MDFInternationalization.framework/Headers -I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/MaterialComponents/MaterialComponents.framework/Headers -I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/lottie-ios/Lottie.framework/Headers -I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/internal/Swift-Modules -I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/internal -I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/../../app/App_Resources/iOS/src -I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/../../node_modules/nativescript-lottie/platforms/ios/src -I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/../../node_modules/nativescript-unit-test-runner/platforms/ios/src -I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/../../node_modules/@nativescript/core/platforms/ios/src -F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator -F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/internal/ -F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator -F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization -F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/MaterialComponents -F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/lottie-ios -F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/../../node_modules/@nativescript/core/platforms/ios -DCOCOAPODS=1 -DDEBUG=1 
Clang Arguments: 
"-v", "-x", "objective-c", "-fno-objc-arc", "-fmodule-maps", "-ferror-limit=0", "-Wno-unknown-pragmas", "-Wno-ignored-attributes", "-Wno-nullability-completeness", "-Wno-expansion-to-defined", "-D__NATIVESCRIPT_METADATA_GENERATOR=1", "-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk", "-mios-simulator-version-min=9.0", "-std=gnu99", "-target", "x86_64-apple-ios13.0-macabi", "-I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/include", "-I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization/MDFInternationalization.framework/Headers", "-I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/MaterialComponents/MaterialComponents.framework/Headers", "-I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/lottie-ios/Lottie.framework/Headers", "-I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/internal/Swift-Modules", "-I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/internal", "-I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/../../app/App_Resources/iOS/src", "-I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/../../node_modules/nativescript-lottie/platforms/ios/src", "-I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/../../node_modules/nativescript-unit-test-runner/platforms/ios/src", "-I/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/../../node_modules/@nativescript/core/platforms/ios/src", "-F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator", "-F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/internal/", "-F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator", "-F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization", "-F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/MaterialComponents", "-F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/lottie-ios", "-F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/../../node_modules/@nativescript/core/platforms/ios", "-DCOCOAPODS=1", "-DDEBUG=1", 
Merged 743 categories.
Result: 43130 declarations from 137 top level modules
Done! Running time: 4.39582 sec 
Saving metadata generation's stderr stream to: /Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/metadata-generation-stderr-x86_64.txt
~/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios
ld: warning: directory not found for option '-F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization'
ld: warning: directory not found for option '-F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/MaterialComponents'
ld: warning: directory not found for option '-F/Users/jim/Forked-Git-Projects/nativescript-lottie/demo/platforms/ios/build/Debug-iphonesimulator/lottie-ios'
ld: framework not found Lottie
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
** BUILD FAILED **

Unable to apply changes on device: 0767D9CD-69EE-46EC-974A-2222F2E8A37F. Error is: Command xcodebuild failed with exit code 65.
JimLynchCodes commented 3 years ago

vue-demo gives me this different error...

ERROR in ./app.ts
Module build failed (from ../node_modules/ts-loader/index.js):
Error: TypeScript emitted no output for /Users/jim/Forked-Git-Projects/nativescript-lottie/demo-vue/app/app.ts.
    at makeSourceMapAndFinish (/Users/jim/Forked-Git-Projects/nativescript-lottie/demo-vue/node_modules/ts-loader/dist/index.js:54:18)
    at successLoader (/Users/jim/Forked-Git-Projects/nativescript-lottie/demo-vue/node_modules/ts-loader/dist/index.js:41:5)
    at Object.loader (/Users/jim/Forked-Git-Projects/nativescript-lottie/demo-vue/node_modules/ts-loader/dist/index.js:24:5)

ERROR in /Users/jim/Forked-Git-Projects/nativescript-lottie/demo-vue/app/app.ts
./app.ts
[tsl] ERROR in /Users/jim/Forked-Git-Projects/nativescript-lottie/demo-vue/app/app.ts(2,18)
      TS2307: Cannot find module './components/Home.vue' or its corresponding type declarations.

ERROR in /Users/jim/Forked-Git-Projects/nativescript-lottie/demo-vue/app/app.ts
./app.ts
[tsl] ERROR in /Users/jim/Forked-Git-Projects/nativescript-lottie/demo-vue/app/app.ts(11,5)
      TS2351: This expression is not constructable.
  Type 'NativeScriptVueConstructor' has no construct signatures.
JimLynchCodes commented 3 years ago

my ns info output:

Error while loading nativescript-cloud is: Default commands should be required before child commands
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 7.1.2 and the latest available version is 7.2.0.
⚠ Update available for component @nativescript/core. Your current version is 7.0.1 and the latest available version is 7.2.1.
⚠ Update available for component @nativescript/ios. Your current version is 7.1.1 and the latest available version is 7.2.0.
✖ Component @nativescript/android is not installed.
bradmartin commented 3 years ago

I went ahead and updated the scripts from the root (on master now)

npm run demo.android npm run demo.ios

Others are:

    "demo.ng.ios": "cd src && npm run setup && cd ../demo-angular && tns run ios",
    "demo.ng.android": "cd src && npm run setup && cd ../demo-angular && tns run android",
    "demo.vue.ios": "cd src && npm run setup && cd ../demo-vue && tns run ios",
    "demo.vue.android": "cd src && npm run setup && cd ../demo-vue && tns run android"

listed in the root package.json if you want to run the demos 👍

I tested the plain ns demo and it ran successfully.

bradmartin commented 3 years ago

Just corrected the angular demo, runs fine now.