semicolonsknu / knubus

강원대학교 교내 순환버스 정보
0 stars 2 forks source link

빌드 시 Google API를 통한 지도 출력 오류 #45

Open sugoring opened 4 months ago

sugoring commented 4 months ago

빌드 후 Google Maps가 제대로 출력되지 않습니다.

TODO 목록

semicolonsknu commented 4 months ago

Install dependencies 20s

Running "yarn install" in /home/expo/workingdir/build/frontend directory yarn install v1.22.19 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] Resolving packages... [2/4] Fetching packages... error Command failed. Exit code: 128 Command: git Arguments: ls-remote --tags --heads ssh://git@github.com/react-native-elements/react-native-elements.git Directory: /home/expo/workingdir/build/frontend Output: Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. yarn install exited with non-zero code: 128

Fail build 1s

Build failed

yarn install exited with non-zero code: 128

sugoring commented 4 months ago

Install dependencies 20s

Running "yarn install" in /home/expo/workingdir/build/frontend directory yarn install v1.22.19 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] Resolving packages... [2/4] Fetching packages... error Command failed. Exit code: 128 Command: git Arguments: ls-remote --tags --heads ssh://git@github.com/react-native-elements/react-native-elements.git Directory: /home/expo/workingdir/build/frontend Output: Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. yarn install exited with non-zero code: 128

Fail build 1s

Build failed

yarn install exited with non-zero code: 128

yarn과 npm을 혼용하여 사용하여 나타난 결과

sugoring commented 4 months ago

yarn은 설치한 패키지와 종속되는 패키지를 공통적으로 사용할 때 일렬로 나열한 뒤 설치 패키지로 링크하는 방식으로. 패키지 중복이 제거되어 적은 용량으로 빠른 실행을 꾀할 수 있으나 네이티브 및 yarn을 고려하지 않은 버전 관리로 인한 드문 케이스로 패키지 충돌이 있을 수 있다.

npm은 각 설치한 패키지별로 서브패키지를 이루는 형식으로, 각 설치한 패키지의 독립성이 보장되지만 패키지 중복으로 인한 크기가 전체적으로 커진다.

sugoring commented 4 months ago

npm 캐시 지우기 - npm cache verify Yarn 캐시 지우기 - yarn cache clean

sugoring commented 4 months ago

https://docs.expo.dev/versions/latest/sdk/build-properties/?redirected

sugoring commented 4 months ago

package-lock.json 파일의 중요성 프로젝트에 사용될 npm package들은 package.json 파일로 관리된다. 이때 npm install 명령어로 package들이 설치가 되면 package-lock.json 파일이 생성된다.

package-lock.json 파일은 작업자의 개발환경에서 npm install 할 때 종속성 관련 정보가 package-lock.json 파일에 반영된다. npm 을 이용하여 개발을 하다보면 이 종속성 문제가 상당히 골치가 아플때가 많다.

예를 들어 A란 package의 최신 버전이 릴리즈 되어서 A package를 사용하려고 해도 다른 package에서 종속성에 문제가 발생하면 A package를 쓰지 못하거나 A package와 종속성이 관련된 package들를 찾아서 같이 버전업 해줘야 사용 가능하다.

따라서, Git 과 같은 코드 형상 관리 시스템을 이용한다면 package-lock.json 파일도 함께 Commit 해 주어야 다른 개발 환경에서도 동일한 버전의 npm 라이브러리 관리가 가능해진다.

sugoring commented 4 months ago

Running 'gradlew :app:assembleRelease' in /home/expo/workingdir/build/frontend/android Downloading https://services.gradle.org/distributions/gradle-8.3-all.zip 10 %. 20%. 30%. 40%. 50 %. 60%. 70%. 80%. 90%. 100% Welcome to Gradle 8.3! Here are the highlights of this release:

sugoring commented 4 months ago

expo 로 안드로이드 빌드 후 apk 생성 하였습니다.

각 화면은 작동하는 데, 서비스키를 활용 하는 부분만 아무런 작동을 하지 않습니다.


첫번째, 공공데이터를 활용하는 부분 두번째, react-native-maps를 활용하는 부분

서비스키 활용이 문제라고 판단되어 해당 부분을 설명합니다. 첫번째, 공공데이터를 활용하는 부분의 서비스키는 js 파일내에서 활용하고 있습니다. const serviceKey = 키키키키키 const holidayUrl = http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getHoliDeInfo?solYear=${year}&solMonth=${month}&ServiceKey=${serviceKey}&_type=json 두번째, react-native-maps를 활용하는 부분은 app.json에서 활용하고 있습니다. "android": { "config": { "googleMaps": { "apiKey": 키키키키키

    }
  },

권한 설정은 해당과 같이 사용하였습니다. "permissions": [ "INTERNET", "ACCESS_NETWORK_STATE", "ACCESS_COARSE_LOCATION", ],

sugoring commented 4 months ago

expo 로 안드로이드 빌드 후 apk 생성 하였습니다.

각 화면은 작동하는 데, 서비스키를 활용 하는 부분만 아무런 작동을 하지 않습니다.

첫번째, 공공데이터를 활용하는 부분

두번째, react-native-maps를 활용하는 부분 서비스키 활용이 문제라고 판단되어 해당 부분을 설명합니다. 첫번째, 공공데이터를 활용하는 부분의 서비스키는 js 파일내에서 활용하고 있습니다. const serviceKey = 키키키키키 const holidayUrl = http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getHoliDeInfo?solYear=${year}&solMonth=${month}&ServiceKey=${serviceKey}&_type=json 두번째, react-native-maps를 활용하는 부분은 app.json에서 활용하고 있습니다. "android": { "config": { "googleMaps": { "apiKey": 키키키키키

    }
  },

권한 설정은 해당과 같이 사용하였습니다. "permissions": [ "INTERNET", "ACCESS_NETWORK_STATE", "ACCESS_COARSE_LOCATION", ],

안드로이드 빌드 후 네트워크 안되는 에러면, 안드로이드 빌드되면 디폴트로 http 통신을 안하고 https 만 통신할꺼에요

sugoring commented 4 months ago

expo 로 안드로이드 빌드 후 apk 생성 하였습니다.

각 화면은 작동하는 데, 서비스키를 활용 하는 부분만 아무런 작동을 하지 않습니다.

첫번째, 공공데이터를 활용하는 부분

두번째, react-native-maps를 활용하는 부분 서비스키 활용이 문제라고 판단되어 해당 부분을 설명합니다. 첫번째, 공공데이터를 활용하는 부분의 서비스키는 js 파일내에서 활용하고 있습니다. const serviceKey = 키키키키키 const holidayUrl = http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getHoliDeInfo?solYear=${year}&solMonth=${month}&ServiceKey=${serviceKey}&_type=json 두번째, react-native-maps를 활용하는 부분은 app.json에서 활용하고 있습니다. "android": { "config": { "googleMaps": { "apiKey": 키키키키키

    }
  },

권한 설정은 해당과 같이 사용하였습니다. "permissions": [ "INTERNET", "ACCESS_NETWORK_STATE", "ACCESS_COARSE_LOCATION", ],

https://stackoverflow.com/questions/77090627/react-native-expo-android-http-server-network-request-failed

sugoring commented 4 months ago

eas build:configure

eas build:configure을 통해서 eas.json파일을 생성해준다.

sugoring commented 4 months ago

eas build --platform android --profile semicolons

semicolonsknu commented 4 months ago

eas build --platform android --profile semicolons --auto-submit