Comments (18)
Can you confirm this happens even after running ns clean
first?
Please also include the contents of your package.json
.
from nativescript.
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.
@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.
@NathanWalker, I ran rm -rf ~/Library/Developer/Xcode/DerivedData and then ns clean but it still returns the same error.
from nativescript.
I am also having this exact error. Please can we get help with this ? @NathanWalker
from nativescript.
@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.
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.
I got back on my feet again by downgrading to @nativescript/core": "~8.6.2
and @nativescript/ios": "8.6.4
.
from nativescript.
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.
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
from nativescript.
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
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.
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.
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.
I got back on my feet again by downgrading to
@nativescript/core": "~8.6.2
and@nativescript/ios": "8.6.4
.
Worked...
from nativescript.
from nativescript.
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.
@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.
@rigor789 Yes, I tried manually and also using the migrate command.
from nativescript.
Related Issues (20)
- TextField with [secure] string don't work on Android with core plugin 8.6.2 HOT 10
- ns build iOS and Xcode build not working after upgrade to xcode 15 HOT 5
- ResumeEvent in a component's constructor not triggering
- TypeError: Cannot read properties of undefined (reading 'env')
- Transfer nativescript.org Domain To The OpenJS Foundation
- RootLayout enterFrom animation bugged on iOS
- ReferenceError: NSURLSessionConfiguration is not defined HOT 12
- Missing API declarations & calling of restricted APIs HOT 8
- Android apps becomes unresponsive after resolution change
- NS PREVIEW don't working properly HOT 8
- Overlap using GridLayout iOS issue HOT 1
- [Known Issue] `npm i -g nativescript` error: gyp: binding.gyp not found HOT 2
- [feature] Allow bundler, eslint and typings generator to show API/SDK version availability warnings
- Upgrading to @nativescript/webpack-5.0.19 requires upgrade to @nativescript/core-8.7.0 HOT 3
- Devtools 0.0.1 Error: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String HOT 1
- [android] Image tintColor set to null will cause a throwable
- Frequent ANR: __cxa_throw ANR triggered by slow operations in main thread HOT 2
- ActionBar Blocking Events on Android by default HOT 3
- Spawn error on windows HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript.