Team/난감했던 이슈들

[ IONIC ] Firebase 설치 이슈

HEON.D 2021. 3. 19. 15:20

삭제

ionic cordova platform remove android

ionic cordova platform remove ios

rm -rf platforms && rm -rf plugins

 

설치

ionic cordova platform add android@9.0.0

ionic cordova platform add ios@5.0.1

 

안드로이드 +9 이상만 출시가능함 / ioS 5.0.1 버전 외 알림권한 비정상

 

플러그인 설치

ionic cordova plugin add cordova-plugin-firebase

npm install @ionic-native/firebase

 

에러

Android

ailed to install 'cordova-plugin-firebase': Error: Uh oh!

EPERM: operation not permitted, unlink '/Users/heon/Project/Haksik/abp/HaksikClientV5/platforms/android/app/src/main'

at Object.unlinkSync (fs.js:1035:3)

 

iOS

Failed to install 'cordova-plugin-firebase': CordovaError: Using "requireCordovaModule" to load non-cordova module "xcode" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.

 

해결

안드로이드 해결

forum.ionicframework.com/t/error-with-cordova-plugin-firebase/161220/2

  • Rename the file GoogleService-Info.plist in our root folder to GoogleService-Info.plistxx
  • Remove the file inside your platform/ios/AppName/Resources/GoogleService-Info.plist
  • Run the command ionic cordova plugin add cordova-plugin-firebase
  • Rename the file GoogleService-Info.plistxx in our root folder to GoogleService-Info.plist

파일명을 속여서 플러그인 설치

 

IOS 해결

plugins/cordova-plugin-firebase/script/ios/helper.js 파일 수정

var xcode = context.requireCordovaModule("xcode");

이 부분 두군데를

var xcode = require("xcode"); 으로 변경