Giter Site home page Giter Site logo

Comments (18)

rigor789 avatar rigor789 commented on May 19, 2024

Can you confirm this happens even after running ns clean first?

Please also include the contents of your package.json.

from nativescript.

NathanWalker avatar NathanWalker commented on May 19, 2024

This can also be seen if you haven't cleared DerivedData in awhile.
You can run this command:

rm -rf ~/Library/Developer/Xcode/DerivedData

Then ns clean and run.

from nativescript.

paulmlilo avatar paulmlilo commented on May 19, 2024

@rigor789 Yes it happens after running ns clean.

Here is my package.json.

{
  "name": "app",
  "main": "./src/main.ts",
  "version": "2.1.1",
  "private": true,
  "nativescript": {
    "id": "example.example.app"
  },
  "dependencies": {
    "@angular/animations": "~17.3.4",
    "@angular/common": "~17.3.4",
    "@angular/compiler": "~17.3.4",
    "@angular/core": "~17.3.4",
    "@angular/forms": "~17.3.4",
    "@angular/platform-browser": "~17.3.4",
    "@angular/platform-browser-dynamic": "~17.3.4",
    "@angular/router": "~17.3.4",
    "@heywhy/ns-secure-storage": "~0.3.0",
    "@nativescript-community/push": "~1.1.11",
    "@nativescript-community/ui-image": "~4.3.40",
    "@nativescript-community/ui-mapbox": "~6.2.27",
    "@nativescript-community/ui-material-bottomnavigationbar": "~7.2.49",
    "@nativescript-community/ui-material-slider": "^7.2.49",
    "@nativescript-community/ui-pager": "~14.1.19",
    "@nativescript-community/ui-pulltorefresh": "~2.5.3",
    "@nativescript-community/universal-links": "^3.0.1",
    "@nativescript/angular": "~17.0.0",
    "@nativescript/appavailability": "~2.0.0",
    "@nativescript/auto-fit-text": "~1.0.3",
    "@nativescript/biometrics": "~1.3.1",
    "@nativescript/camera": "~5.1.0",
    "@nativescript/contacts": "~2.1.0",
    "@nativescript/core": "~8.7.0",
    "@nativescript/datetimepicker": "~2.1.13",
    "@nativescript/geolocation": "~8.3.1",
    "@nativescript/haptics": "^3.0.2",
    "@nativescript/imagepicker": "~3.1.1",
    "@nativescript/iqkeyboardmanager": "~2.1.1",
    "@nativescript/social-share": "~2.3.0",
    "@nativescript/tailwind": "^2.0.1",
    "@nativescript/theme": "~3.0.1",
    "@nstudio/ui-collectionview": "~5.1.8",
    "@triniwiz/nativescript-star-ratings": "^2.0.3",
    "anchorme": "^3.0.5",
    "dayjs": "^1.11.10",
    "geolocation-utils": "~1.2.5",
    "global": "^4.4.0",
    "google-libphonenumber": "~3.2.34",
    "jwt-decode": "3.1.2",
    "lodash": "^4.17.21",
    "nativescript-audio": "^6.2.6",
    "nativescript-barcodescanner": "~4.1.2",
    "nativescript-calendar": "~3.0.0",
    "nativescript-clipboard": "^2.1.1",
    "nativescript-feedback": "^2.0.0",
    "nativescript-hook": "~0.2.5",
    "nativescript-imagecropper": "~4.0.3",
    "nativescript-inappbrowser": "^3.2.0",
    "nativescript-phone": "^3.0.3",
    "nativescript-uuid-v2": "~2.0.1",
    "ngx-mask": "^17.0.7",
    "rxjs": "~7.8.1",
    "short-crypt": "^3.0.6",
    "tailwindcss": "~3.4.3",
    "throttle-debounce": "~5.0.0",
    "ts-deepmerge": "^7.0.0",
    "zone.js": "~0.14.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~17.3.4",
    "@angular/compiler-cli": "~17.3.4",
    "@nativescript/android": "~8.7.0",
    "@nativescript/debug-ios": "~1.0.0",
    "@nativescript/ios": "8.7.0",
    "@nativescript/types": "~8.7.0",
    "@nativescript/types-android": "~8.7.0",
    "@nativescript/types-ios": "~8.7.0",
    "@nativescript/webpack": "^5.0.19",
    "@ngtools/webpack": "~17.3.4",
    "@types/lodash": "~4.17.0",
    "@types/node": "~20.12.7",
    "@types/throttle-debounce": "^5.0.2",
    "postcss": "^8.4.38",
    "postcss-loader": "^8.1.1",
    "prettier": "~3.2.5",
    "prettier-plugin-organize-imports": "^3.2.4",
    "prettier-plugin-tailwindcss": "^0.5.13",
    "typescript": "~5.4.5"
  },
  "packageManager": "[email protected]"
}

from nativescript.

paulmlilo avatar paulmlilo commented on May 19, 2024

@NathanWalker, I ran rm -rf ~/Library/Developer/Xcode/DerivedData and then ns clean but it still returns the same error.

from nativescript.

israelglory avatar israelglory commented on May 19, 2024

I am also having this exact error. Please can we get help with this ? @NathanWalker

from nativescript.

israelglory avatar israelglory commented on May 19, 2024

@NathanWalker @paulmlilo apparently i inspected the error to the nodemudles and figured the nativescript core ios utils folder has an index.js folder and this function is the one causing my app to break, :

export function getWindow() {
let window;
if (SDK_VERSION >= 15) {
// UIWindowScene.keyWindow is only available 15+
window = NativeScriptViewFactory.getKeyWindow(); <--------- the problem
}
if (window) {
return window;
}
const app = UIApplication.sharedApplication;
if (!app) {
return;
}
return app.keyWindow || (app.windows && app.windows.count > 0 && app.windows.objectAtIndex(0));
}

please what do you need to do ?

from nativescript.

pazaan avatar pazaan commented on May 19, 2024

I can repro this just using a blank sample project.

I'm on a 2019 Intel MBP running macOS 14.4.1, with Xcode 15.3, iOS SDK 17.4 and ns 8.7.0.

% ns create vue-sample --vue --ts
% cd vue-sample
% ns run ios # works fine, runs on my attached device
% ns run ios --bundle --release # runs, then crashes on my attached device

The generated package.json is:

{
  "name": "vue-sample",
  "main": "app/app.ts",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@nativescript/core": "~8.7.0",
    "@nativescript/theme": "~3.0.2",
    "nativescript-vue": "~2.9.3"
  },
  "devDependencies": {
    "@nativescript/ios": "8.7.0",
    "@nativescript/types": "~8.7.0",
    "@nativescript/webpack": "~5.0.19",
    "@types/node": "~17.0.21",
    "nativescript-vue-template-compiler": "~2.9.3",
    "typescript": "~5.4.0",
    "vue": "~2.6.12"
  }
}

Crashes with:

  ***** Fatal JavaScript exception - application has been terminated. *****
  NativeScript encountered a fatal error:
  Uncaught ReferenceError: NativeScriptViewFactory is not defined
   at
  	getWindow(file:///var/containers/Bundle/Application/367C52DC-DF32-40B1-846F-30F36C41A51B/vuesample.app/app/vendor.js:2:861673)
  	at get window(file:///var/containers/Bundle/Application/367C52DC-DF32-40B1-846F-30F36C41A51B/vuesample.app/app/vendor.js:2:27298)
  	at didFinishLaunchingWithOptions(file:///var/containers/Bundle/Application/367C52DC-DF32-40B1-846F-30F36C41A51B/vuesample.app/app/vendor.js:2:29697)
  	at (file:///var/containers/Bundle/Application/367C52DC-DF32-40B1-846F-30F36C41A51B/vuesample.app/app/vendor.js:2:23442)

I noticed that the --release version has a minified vendor.js, whereas the non-release version doesn't. I'll keep digging into this to see if I can narrow it down some more.

Webpack was a red herring. When I explicitly set mode to development, I still get the crash.

It doesn't even have to be a Vue example. I get the same even when doing a vanilla TS project: ns create example-app --ts

from nativescript.

pazaan avatar pazaan commented on May 19, 2024

I got back on my feet again by downgrading to @nativescript/core": "~8.6.2 and @nativescript/ios": "8.6.4.

from nativescript.

NathanWalker avatar NathanWalker commented on May 19, 2024

I'm curious @pazaan @israelglory @paulmlilo if the projects where you're seeing this have a build.xcconfig or Podfile you could share?
We're not seeing this here, even with ns create, so perhaps something else we could check that could bring about the condition?
If each would be able to respond with output of following would be helpful as well:

node -v
npm -v
ns -v
ruby --version
pod --version

from nativescript.

israelglory avatar israelglory commented on May 19, 2024

v20.3.1
9.6.7
8.7.0
✔ Up to date.
ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [arm64-darwin22]
1.15.2

@NathanWalker

from nativescript.

CatchABus avatar CatchABus commented on May 19, 2024

v20.3.1 9.6.7 8.7.0 ✔ Up to date. ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [arm64-darwin22] 1.15.2

@NathanWalker

We happen to have a fix in next release that solves problems similar to this one: NativeScript/ios#248
Can you try npm i @nativescript/ios@next and see if next solves it for you?

from nativescript.

pazaan avatar pazaan commented on May 19, 2024

I'm curious @pazaan @israelglory @paulmlilo if the projects where you're seeing this have a build.xcconfig or Podfile you could share? We're not seeing this here, even with ns create, so perhaps something else we could check that could bring about the condition? If each would be able to respond with output of following would be helpful as well:

node -v
npm -v
ns -v
ruby --version
pod --version
% node -v
v20.12.2
% npm -v # Intentionally downgraded because of https://github.com/NativeScript/NativeScript/issues/10509
10.3.0
% ns -v
8.7.0
✔ Up to date.
% ruby --version
ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [x86_64-darwin22]
% pod --version
1.15.2

I don't have a Podfile:

% find . -name "*Podfile*"
%

@NathanWalker Which build.xcconfig would you like to see?

% find . -name build.xcconfig         
./platforms/ios/build/Release-iphoneos/exampleapp.xcarchive/Products/Applications/exampleapp.app/build.xcconfig
./platforms/ios/build/Debug-iphoneos/exampleapp.xcarchive/Products/Applications/exampleapp.app/build.xcconfig
./platforms/ios/exampleapp/build.xcconfig
./platforms/ios/exampleapp/Resources/build.xcconfig
./node_modules/@nativescript/ios/framework/__PROJECT_NAME__/build.xcconfig
./App_Resources/iOS/build.xcconfig

Edit: Assume you mean App_Resources...

ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = E53PUHPBVX

from nativescript.

pazaan avatar pazaan commented on May 19, 2024

We happen to have a fix in next release that solves problems similar to this one: NativeScript/ios#248
Can you try npm i @nativescript/ios@next and see if next solves it for you?

Updating to next didn't appear to help.

% npm i -D @nativescript/ios@next
% ns run ios --clean --release # <--- still crashes

from nativescript.

israelglory avatar israelglory commented on May 19, 2024

I got back on my feet again by downgrading to @nativescript/core": "~8.6.2 and @nativescript/ios": "8.6.4.

Worked...

from nativescript.

paulmlilo avatar paulmlilo commented on May 19, 2024

@NathanWalker
Screenshot 2024-04-23 at 01 37 34

from nativescript.

tomcoonen avatar tomcoonen commented on May 19, 2024

I don't know if it's related, but I also had an issue on 8.7.0 (release build):

Fatal Exception: java.lang.RuntimeException Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function ReferenceError: __registerDomainDispatcher is not defined File: (file:///data/data/xxxx/files/app/vendor.js:2:849906) StackTrace: (file:///data/data/xxxx/files/app/vendor.js:2:849907)

from nativescript.

rigor789 avatar rigor789 commented on May 19, 2024

@tomcoonen was @nativescript/android updated to 8.7.x as well? I believe the stack you shared can happen when using core 8.7.x but old android runtime version. I think we can add another check before including the inspector_modules in webpack to ensure both core and runtime are supporting them.

from nativescript.

tomcoonen avatar tomcoonen commented on May 19, 2024

@rigor789 Yes, I tried manually and also using the migrate command.

from nativescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.