ptmt / react-native-macos

[deprecated in favor of https://microsoft.github.io/react-native-windows/] React Native for macOS is an experimental fork for writing desktop apps using Cocoa
MIT License
11.25k stars 429 forks source link

Build failed on macOS 10.14 #207

Closed brunolemos closed 6 years ago

brunolemos commented 6 years ago

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Command info unrecognized

Environment: OS: macOS Sierra 10.14 Beta Node: 10.7.0 Yarn: 1.7.0 npm: 6.2.0 Watchman: 4.90 Xcode: Xcode 9.4.1 and 10 Android Studio: 3.1

Packages: (wanted => installed) "react": "16.2.0", "react-native-macos": "0.18.0-alpha.6"

Target Platform: macOS (10.4)

Steps to Reproduce

Build failed when starting a new project from scratch.

  1. react-native-macos init projectname
  2. cd projectname
  3. react-native-macos run-macos

Expected Behavior

Build successfully and open app

Actual Behavior

** BUILD FAILED **

/Users/brunolemos/Projects/projectname/node_modules/react-native-macos/React/Modules/RCTAppearance.m:23:44: error: property 'effectiveAppearance' not found on
      object of type '__kindof NSApplication *'
  [NSAppearance setCurrentAppearance:NSApp.effectiveAppearance];
                                           ^
1 error generated.

Reproducible Demo

It's a new project without any modification.

iHongRen commented 6 years ago

try this:
[NSAppearance setCurrentAppearance:[NSApp mainWindow].effectiveAppearance];

brunolemos commented 6 years ago

@iHongRen thanks, that fixed the xcode build error 🎉

Then, I got this: bundling failed: ReferenceError: Unknown plugin "module-resolver" specified Installing babel-plugin-module-resolver fixed it and the app worked!

Do you plan making a PR?

ptmt commented 6 years ago

fixed in the latest version