Skip to content

Build fails with Xcode 10 with error could not find included file '../plugins-debug.xcconfig' in search paths #3912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rosen-vladimirov opened this issue Sep 19, 2018 · 23 comments
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

rosen-vladimirov commented Sep 19, 2018

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes

Tell us about the problem

Build fails for iOS in case the following circumstances are fulfilled:

  • Xcode 10 is used
  • application does not have build.xcconfig file in App_Resources/iOS/build.xcconfig
  • none of the plugins have build.xcconfig file in <plugin dir>/platforms/ios/build.xcconfig

The error is:

error: <path to project>/platforms/ios/<app name>/build-debug.xcconfig:3: could not find included file '../plugins-debug.xcconfig' in search paths (in target 'tests')

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.2.4
  • Cross-platform modules: Not applicable
  • Runtime(s): Not applicable
  • Plugin(s): Ensure all plugins do not have build.xcconfig in <plugin dir>/platforms/ios

Please tell us how to recreate the issue in as much detail as possible.

$ tns create app1
$ cd app1
$ rm app/App_Resources/iOS/build.xcconfig
$ tns build ios

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

No

Workaround

Create empty build.xcconfig in <path to project's App_Resources>/iOS/build.xcconfig

@anaszgh
Copy link

anaszgh commented Oct 17, 2018

Is there a way to fix this issue on version 4.2.4?

@anaszgh
Copy link

anaszgh commented Oct 19, 2018

@rosen-vladimirov build.xcconfig already is there in the <App_Resources>/IOS but still the issue occur

@MarkPieszak
Copy link

After doing workaround above and deleting build-debug file, it builds a little bit further but throws a new error

The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

@Fatme
Copy link
Contributor

Fatme commented Oct 20, 2018

@MarkPieszak,

You need to update your CocoaPods. Just execute pod install.

@FranciZ
Copy link

FranciZ commented Oct 26, 2018

Any suggestions on how to solve this for 4.2.4? Can't build with Xcode10 at this point.

@anaszgh
Copy link

anaszgh commented Oct 26, 2018

You can downgrade your XCode Version 9, thats what I've done and its working fine.

@rosen-vladimirov
Copy link
Contributor Author

Hey guys, you can install CLI's rc version and try this fix:

npm i -g nativescript@rc

@shivgolani
Copy link

@rosen-vladimirov still getting this issue have upgraded CLI version to 5.1.0-2018-11-14-12579

@felicks
Copy link

felicks commented Nov 30, 2018

same issue for version 4.2.3

@NL33
Copy link

NL33 commented Dec 6, 2018

bump. same issue. Any solutions?

@rosen-vladimirov
Copy link
Contributor Author

Hey guys,
can you please provide your steps, so we can try to reproduce the issue on our side? Do you use tns build ios when you receive the error?

@NL33
Copy link

NL33 commented Dec 6, 2018

For me:
Nativescript v5.0.3
CLI updated yesterday
xcode 10.0

Since updating to 5.0.3 today, I actually have not been able to get any emulator / simulator working at all. Maybe in my case there is an issue with my steps. I am moving toward production, so I want to use webpack:

1) $ tns build ios --bundle --env.development --env.uglify --env.aot 

2)$ tns run ios --bundle --env.development --env.uglify --env.aot      //no errors reported on my terminal. Just: "Found 0 errors. Watching for file changes". However, **nothing actually happens on the emulator or my phone** if my phone is plugged in

3) Try to open the project in xcode (open [appname].xcodeproj

4) If I hit the play icon in xcode (the build button), build fails with errors (repeated 3 times):

/.../build-debug.xcconfig:3: could not find included file '.../plugins-debug.xcconfig' in search paths (in target [appname])

EDIT Note: note that every time I run in xcode it also requires that I again enter a product bundle identifier, which it has not previously done.

Is there maybe a mistake in how I am building the app?

@rosen-vladimirov
Copy link
Contributor Author

Hey @NL33 ,
can you please try the following:

  1. Delete your platforms directory
  2. Execute tns run ios --bundle --env.development --env.uglify --env.aot - it should build the application, deploy it on device/simulator and start it, so it may take a while.
  3. Open the workspace in <project dir>/platforms/ios/<project name>.xcworkspace or if it does not exist: <project dir>/platforms/ios/<project name>.xcodeproj
  4. Try building the application in Xcode.

Btw is there a reason to use Xcode for building the app instead of using tns build ios ?

@NL33
Copy link

NL33 commented Dec 6, 2018

Thanks, I will try it.

Regarding why I tried xcode:

  1. I tried it after I was not able to get anything to work on my terminal with the $tns commands
  2. Given that I am prepping an app to put onto the app store, I thought I would test it with xcode too.

By the way, the webpack process for production is still a little bit of a mystery. I would like to:
--test the app locally with webpack. I assume I use the tns run ios --bundle --env.development... for that. and then
--bundle the app however I need for production. I assume I use tns run ios --bundle --release for that.

If this is right, is it ok to run a local 'run' (creating 1 bundle) and then a release 'run' (creating another)?

@NL33
Copy link

NL33 commented Dec 6, 2018

I just tried your suggestion, and things did not work:

  1. Deleted my platforms directory
  2. Ran$ tns run ios --bundle --env.development --env.uglify --env.aot ... (note I also have some environmental variables included, with --env.variable='variableValue', but I don't think that makes a difference as I am not getting any errors).
  3. After running $ tns run ios --bundle ..., nothing happens--same as before. terminal says: Found 0 errors. Watching for file changes.

And it does not put back my platforms directory. So after deleting my platform directory and then running tns run ios --bundle..., I still do not have a platforms directory.

Edit: When I manually put back the platforms directory with $ tns add ios, and then run $ tns run ios --bundle ... again, I now I have a platforms directory, but same result: Found 0 errors. Watching for file changes (with no result on emulator or device)

@rosen-vladimirov
Copy link
Contributor Author

Can you please try tns run ios --bundle --env.development --env.uglify --env.aot --log trace - it should print much more output and we'll probably see where it is hang.
Also can you please send your package.json content?

@NL33
Copy link

NL33 commented Dec 6, 2018

Sure. Thanks for your help:

package.json:

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "com.[name.appname]",  //edited here for purposes of posting
    "tns-ios": {
      "version": "5.0.0"
    }
  },
  "dependencies": {
    "@angular/animations": "~7.0.0",
    "@angular/common": "~7.0.0",
    "@angular/compiler": "~7.0.0",
    "@angular/core": "~7.0.0",
    "@angular/forms": "~7.0.0",
    "@angular/http": "~7.0.0",
    "@angular/platform-browser": "~7.0.0",
    "@angular/platform-browser-dynamic": "~7.0.0",
    "@angular/router": "~7.0.0",
    "nativescript-angular": "^7.0.2",
    "nativescript-ngx-fonticon": "^4.1.0",
    "nativescript-orientation": "^2.2.0",
    "nativescript-pro-ui": "^3.4.0",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "~0.1.10",
    "rxjs": "^6.3.3",
    "tns-core-modules": "^5.0.5",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~7.0.0",
    "@ngtools/webpack": "~7.0.0",
    "nativescript-dev-typescript": "~0.6.0",
    "nativescript-dev-webpack": "^0.18.1",
    "typescript": "~3.1.1"
  }
}

@NL33
Copy link

NL33 commented Dec 6, 2018

And I ran the $tns run ios --bundle...--log trace

Here is the later parts of the result:
...

Initializing analytics statuses.
Analytics statuses:  { TrackFeatureUsage: 'disabled', TrackExceptions: 'disabled' }
Xcode is installed and is configured properly.
xcodeproj is installed and is configured properly.
CocoaPods are installed.
CocoaPods update is not required.
CocoaPods are configured properly.
Your current CocoaPods version is newer than 1.0.0.
Python installed and configured correctly.
The Python 'six' package is found.
Xcode version 10.0.0 satisfies minimum required version 9.
Exec xcodebuild -version | head -n 1 | sed -e 's/Xcode //' 
 stdout: 10.0
 
 stderr: 
Validate options for platform: iOS
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
startLookingForDevices; platform is iOS
Options for ios-device-discovery { platform: 'iOS',
  shouldReturnImmediateResult: false,
  emulator: false }
Starting to look for iOS devices.
Found device with identifier '….'   //edited for posting
startLookingForDevices; platform is iOS
Options for ios-device-discovery { platform: 'iOS',
  shouldReturnImmediateResult: false,
  emulator: false }
Project dir from hooksArgs is: ….   //edited for posting
Hooks directories: [ '…./hooks' ]  //edited for posting
BeforeHookName for command liveSync is before-liveSync
Executing before-liveSync hook from /…/hooks/before-liveSync/nativescript-angular-sync.js   //edited for posting
Executing before-liveSync hook at location /…/hooks/before-liveSync/nativescript-angular-sync.js in-process  //edited for posting
Validating before-liveSync arguments.
Project dir from hooksArgs is: /….   //edited for posting
Hooks directories: [ '/…/hooks' ]  //edited for posting
BeforeHookName for command watchPatterns is before-watchPatterns

2:14:58 PM - Starting compilation in watch mode...



2:15:07 PM - Found 0 errors. Watching for file changes.

@rosen-vladimirov
Copy link
Contributor Author

Hey @NL33 ,
Thanks for sharing your package.json. I've successfully reproduced your issue with it. The problem is that you are using older version of nativescript-dev-typescript plugin, that is not compatible with your TypeScript version.
To resolve the issue, you can execute the following:

npm i --save-dev nativescript-dev-typescript@latest

Can you give it a try and see if it works on your side?

@NL33
Copy link

NL33 commented Dec 7, 2018

Thanks. I have updated as you say and things seemed to be moving forward--I am at least getting different errors now(!) This is for a project that was working successfully until yesterday (at the time of updating to new nativescript, updating cli, and trying to build with webpack). I am working through some items and will let you know.

@NL33
Copy link

NL33 commented Dec 7, 2018

Using $ tns run ios (just normal run command—no webpack), I am now able to load on my device. It does not fully “work”, because some of the variables are environmental variables to be provided in a webpack build, but it otherwise seems to be operating.

However, the webpack build does not work. Running$ tns run ios --bundle --env.development --env.uglify --env.aot …produces the following errors regarding lazy loading:

Detail: I have tried to implement lazy loading for my components to help app start time. So, for each component, I have a component.html, component.ts, component.module.ts, and component.routing.module.ts.

This has seemed to be fine previously—the $ tns run ios builds work well. However, trying webpack, I now get the following errors for every component (component name edited for posting purposes):

ERROR in ../$$_lazy_route_resource lazy namespace object
Module not found: Error: Can't resolve '/…/app/components/…/….module.ngfactory.js' in '/…/…/$$_lazy_route_resource'
 @ ../$$_lazy_route_resource lazy namespace object ./components/…/….module.ngfactory
 @ ../node_modules/@angular/core/fesm5/core.js
 @ ./app.module.ts
 @ ./main.ts

@NL33
Copy link

NL33 commented Dec 7, 2018

Update: the code is now working on my device when running webpack ($ tns run ios --bundle --env.development --env.uglify --env.aot … ).

As far as I can tell, the only thing I changed between it not working (with the errors above) and it now working is that:

typescript was having some trouble with one of my component ts files. I was getting "Property 'stuff' does not exist on type 'any[]' " errors. So I changed my code a little to remove this error. On the first run since removing any typescript errors, the webpack build was successful.

I am not sure why addressing a typescript error in a single file would stop getting the "Module not found" errors I was previously getting for each component. Perhaps webpack breaks down if there are certain errors present on the build (even if unrelated to lazy loading or component loading), and then fails to load all components?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants