Skip to content
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

'new' is unavailable 'init' has been explicitly marked unavailable here #590

Closed
manielli opened this issue Apr 27, 2021 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@manielli
Copy link

Bug report

Summary

Xcode build fails (even after cleaning build folder).

After installing Xcode 12.5 and Command Line Tools 12.5, Xcode builds fails. The error is under Permission-BluetoothPeripheral Group, ~/node_modules/react-native-permissions/ios/BluetoothPeripheral/RNPermissionHandlerBluetoothPeripheral.m and says: 'new' is unavailable
It also points to CBManager.h saying: 'init' has been explicitly marked unavailable here.

Environment info

react-native info output:

System:
    OS: macOS 11.2.3
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 1.72 GB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.22.0 - ~/.nvm/versions/node/v12.22.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.11 - ~/.nvm/versions/node/v12.22.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK:
      API Levels: 29, 30
      Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.3
      System Images: android-29 | Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7042882
    Xcode: 12.5/12E262 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_282 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.3 => 0.63.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 3.0.1 and 3.0.2

Steps to reproduce

  1. The usual steps to add the library according to documentation.
  2. A Clean build fails.

Describe what you expected to happen:

  1. Build not to fail.

Screen Shot 2021-04-26 at 7 59 08 PM

Reproducible sample code

@mikehardy
Copy link

I'm about 2GB into downloading the 11GB package, I'll see if I can reproduce but won't have news until tomorrow.

@phatlaunchdeck
Copy link

Same problem for me here, and it's launch day lol

@zoontek
Copy link
Owner

zoontek commented Apr 27, 2021

Same as @mikehardy, I need to update. This will be a long day 😅

Screenshot 2021-04-27 at 10 05 23

@mikehardy
Copy link

I needed approx 40GB free before it would update but I'm updated on Xcode now and finishing the macOS 11.3 update then I can reproduce.

FWIW, though the general expectation of all iOS devs is "Use the current stable Xcode", attempting to do so on the actual first day it is out is asking for pain. New minor versions of Xcode always break something. Every single time. And it takes a couple days to sort out.

I use an OSX-KVM in order to sort this sort of thing out as a canary without blowing up my main development rigs (that keep the last minor version until my OSX-KVM is buliding and running things well).

@zoontek zoontek added the bug Something isn't working label Apr 27, 2021
zoontek added a commit that referenced this issue Apr 27, 2021
@zoontek
Copy link
Owner

zoontek commented Apr 27, 2021

The fix is published: https://github.com/zoontek/react-native-permissions/releases/tag/3.0.3, please update 🙂

delabiejochen pushed a commit to MassiveMediaMatch/react-native-permissions that referenced this issue May 4, 2021
@eschos24
Copy link

We are experiencing this issue but are still on RN version 0.60.5. Is there a workaround for us to get this working without having to update to RN 0.63+?

@mikehardy
Copy link

With apologies, RN0.60 is no longer a viable development platform as of the release of iOS 14.5 - you must update to at least RN0.63

Why?

ergo, you must update to at least 0.63.3 to continue releasing iOS apps, so might as well get it done: https://react-native-community.github.io/upgrade-helper/

The repos I maintain are in the process of noting react-native 0.63 is the minimum required react-native version and we're dropping support / no longer testing against releases prior, FWIW

@hzburki
Copy link

hzburki commented May 19, 2021

Summary

  • Same issue as mentioned above
  • I have the latest XCode installed version Version 12.5 (12E262).
  • I upgraded my app to RN 0.63.3 and installed [email protected].

Note: I had to install [email protected] with npm i [email protected] --legacy-peer-deps command. I ran into the dependency tree issue explained in #579.

Steps Taken

  • Ran npm cache clean
  • Ran pod deintegrate & pod install
  • Deleted ios/build
  • Restarted XCode

Environment Info

react-native info output

System:
    OS: macOS 11.3.1
    CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
    Memory: 169.20 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.21.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 7.6.2 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.5/12E262 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.2 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.3 => 0.63.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

@mikehardy
Copy link

This was an Xcode 12.5 issue, definitely fixed. Perhaps npx react-native-clean-project (it's a super deep cleaning depending on how you use it...)

@hzburki
Copy link

hzburki commented May 21, 2021

Upgrading RN to 0.63.3 and the package to 3.0.3 fixed the issue for me however, it did bring a lot of other issues (not related to this package) that I couldn't fix due to short deadlines. So for anyone who wants a quick fix, follow this article which shows how to use package-patch to make quick fixes to the node_modules folder.

The changes to the react-native-permissions node_modules are mentioned here

I got XCode 12.5 to build my app with react-native-permissions version 2.2.2

@bogdandevlpr
Copy link

Simply downgrading Xcode from 12.5 to 12.4 fixed it for me.
I'm using [email protected] and [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants