728x90

✖ Installing Bundler error Your Ruby version is 2.6.10, but your Gemfile specified 2.7.5

ruby version error 해결 

//루비버전관리 프로그램 설치
brew install rbenv

//나는 mac 유저라서 터미널에서 바로 
code . 
//쳐주면 .zshrc파일 들어갈 수 있음. 접근해서 맨밑에 추가함
eval "$(rbenv init -)"

//원하는 버전 설치
rbenv install 2.7.5

//설치완료 확인 (이제는 자동으로 해줘서 안해도 되는 명령어라고 함)
rbenv rehash

//버전 변경 (이것도 자동으로 해주는 거같음 )
rbenv global 2.7.5

//버전확인 
ruby --version

//버전변경했는데도 자꾸 이전 버전이 뜬다면 터미널 껐다가 다시 버전체크해보자. 껐다 다시 킨 다음에야 나는 변경된 걸로 떴음

https://dololgun.github.io/macos/mac-ruby-reinstall/

 

MacOS ruby 버전 관리

mac에서 ruby버전 관리하기

dololgun.github.io

 

근데 ruby가 뭘까?

출처 : https://opentutorials.org/module/2878/16498

객체지향 언어인데 자유도가 있는 언어라고 한다

 

reactnative에서 ruby 쓰는 이유는 

Because iOS uses CocoaPods to handle dependencies which was written in Ruby

ios 가 cocoapods 사용하는데 이게 ruby로 쓰여서.

 

 

 

cocoapods 에러

https://reactnative.dev/docs/next/environment-setup

sudo arch -x86_64 gem install ffi
//이건 프로젝트 폴더 들어가서 cd ios 안에서 했다 pod install 해준 것
arch -x86_64 pod install

 

혹시몰라서 프로젝트 다 삭제하고 

npx react-native init AwesomeTSProject --template react-native-template-typescript

다시 하니 에러 없이 잘 됐다. 

 

 

 

아래글 초기셋팅 참고로 굿

https://zeunny.tistory.com/6

 

[React Native] 공식 문서 보고 Mac OS에서 개발 환경 설정하기

[React Native] 공식 문서 보고 Mac OS에서 개발 환경 설정하기 공식 문서는 아래 링크를 클릭해서 보면 된다. https://reactnative.dev/docs/environment-setup Setting up the development environment · React Native This page will h

zeunny.tistory.com

 

728x90
728x90

핸드폰 개발자 모드로 설정!

usb 컴퓨터와 핸드폰 기기 연결 (c타입-c타입도 됨)

usb 테더링으로 설정

 

만약 다음과 같은 에러시 

 

Task :app:installDebug FAILED
error Failed to install the app. Make sure you have the Android development environment set up:

 

 

cd android

./gradlew clean

 

그리고!!!

 

깔려있는 앱삭제!

 

후 실행 

yarn android

 

 

 

https://velog.io/@rjc1704/React-Native-%EC%97%90%EB%9F%AC-%EB%8C%80%EC%9D%91

 

React Native 에러 로그 (Deprecated Gradle features)

npx react-native run-android 명령어로 앱 실행 시도 할 때 위와 같은 에러가 뜬다면, 아래 2가지 작업만 해주면 된다. 디렉터리 위치를 android 디렉터리 안으로 이동하여 ./gradlew clean 실행 에뮬레이터 또

velog.io

 

728x90
728x90

reactnative 설치 (xcode깔려있어야함.)

yarn ios 로 빌드 되는지 확인 !

 

 

빌드 fail경우 

cd ios

pod deintegrate (pods폴더 삭제)

pod cache clean --all (캐시 삭제)

(혹시 안되면 pod install --repo-update)

xcode preference에 들어가서 derived 폴더 안에 삭제. 

이거는 pod install 하면 다시 생김! 

(뭔말인지 모르겠으면 밑에 링크 참고)

 

yarn 

yarn ios

 

 

 

이제 

 

firebase project만들기

https://firebase.google.com/

 

Firebase

Firebase는 고품질 앱을 빠르게 개발하고 비즈니스를 성장시키는 데 도움이 되는 Google의 모바일 플랫폼입니다.

firebase.google.com

 

Add project

 

프로젝트 이름 넣고 

디폴트 내 계정으로 시작!

 

 

 

다음부터는 쭉 따라하면 되는데 

번들id는 xcode에서 가져와서 붙여넣기 하면 된다. 

(xcode에서 원하는 프로젝트파일 열고, 왼쪽의 프로젝트 파일 누르면 이거 뜸

General 들어가서 

Bundle Identifier 의 값을 복붙하면 됨다. )

 

 

 GoogleService-Info.plist 파일을 

firebase 프로젝트 만드는 곳에서 다운받아서

프로젝트 안에 넣는다 (위치는 거기서 알려줌.)

 

 

그다음에 

AppDelegate.m

에 

 

#import <Firebase.h>

와 

[FIRApp configure];

만 추가!

 

[FIRApp configure]; 이거는 (Bool)로 어플리케이션 실행하는 함수로 보이는 거 하단에 {} 넣어줌. 

위치는 마찬가지로 프로젝트 설명란에 있는데 각자 코드에 맞게 넣으면 된다..

 

 

특이점은 

appPackage를 다운받지 않았다. 

다음단계에서 링크로 들어가서 analytics다운 받는게 있는데 그걸 하지 않고

 

yarn add @react-native-firebase/app

yarn add @react-native-firebase/analytics

 

로 추가했다. (여기에 이미있다고함..)

 

 

아 그리고 analytics는 app과 같은 버전으로 맞춰줘야한다!

 

 

그리고 firebase.json파일을 보면

 

// <project-root>/firebase.json
{
  "react-native": {
    "analytics_auto_collection_enabled": false
  }
}

 

 

false로 꺼져있다.

잘은 모르겠지만 이게  GDPR compliance 정책상으로 꺼져있다고 한다.

앱실행될때 자동으로 집계하게끔 하는게 꺼져있는 것이다. 

대신 이벤트처리하듯

홈화면 들어갈 때 메서드를 이용해서 집계하는 방법을 쓰면 된다.

 

 

To re-enable analytics (e.g. once you have the users consent), call the setAnalyticsCollectionEnabled method:

import { firebase } from '@react-native-firebase/analytics';
// ...
await firebase.analytics().setAnalyticsCollectionEnabled(true);

https://rnfirebase.io/analytics/usage

 

Analytics | React Native Firebase

Copyright © 2017-2020 Invertase Limited. Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. Some partial documentation, under the

rnfirebase.io

 

 

프로젝트 예시 홈화면 들어갈때 추가되도록 했다. 

  const activateAnalytics = async () => {
    await firebase.analytics().setAnalyticsCollectionEnabled(true)
  }
  useEffect(() => {
    activateAnalytics()
  }, [])

 

 

 

 

 

 

 

 

 

 

에러 해결방법 참고한 것들

https://developer.apple.com/forums/thread/703823

 

Xcode 13.3 spits "Requested but di… | Apple Developer Forums

MrtnFbg's answer inspired me to read more about redirections of streams. So I read about Linux STDOUT STDERR. In this specific case when I run this command, there is an output and there are some errors. Since I ran this command on terminal and on terminal

developer.apple.com

https://positiveko-til.vercel.app/til/react-native/error65.html

 

에러 해결🔑 error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. | Positiveko

에러 해결🔑 error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. 리액트 네이티브에서 가장 유명한 에러가 아닐까.. (아니 나참.. 리네 = 에러 픽스 90 + 개발 10 같다.. 후) 이

positiveko-til.vercel.app

 

 

 

 

 

https://rnfirebase.io/analytics/usage

 

Analytics | React Native Firebase

Copyright © 2017-2020 Invertase Limited. Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. Some partial documentation, under the

rnfirebase.io

 

728x90
728x90

Can't use Watchman: "Operation not permitted"

 

Can't use Watchman: "Operation not permitted"

Since updating Watchman recently (with Homebrew) I can no longer use it to watch projects. I get { "version": "2022.05.30.00", "error": "std::__1::system_...

stackoverflow.com

watchman shutdown-server

로 해결

 

 

 

에러가 No bundle URL로 빨갛게 떴는데 

 

아래링크처럼

rm ios/build

로 삭제하고 

xcode에서 삭제해도 그대로 에러창 떴다. 

 

metro로 새로 뜨는 창에 

watchman 에러가 떠서 검색해보았다.

watchman 서버를 끄고 다시 실행하니까 잘 켜졌다. 

 

 

 

 

 

https://juzero-space.tistory.com/261

 

[React Native 에러 해결] IOS, No bundle URL present

1. 에러 상황 이유는 모르겠으나 No bundle URL present 에러가 발생했다. 아마 이것저것 만지다보니 나도 모르게 잘못 건드린거같다 ㅠ 2. 해결방법 해결방법이 간단하다. 다행.. 첫번째 방법) ios/build

juzero-space.tistory.com

 

 

728x90

+ Recent posts