Skip to content

[BUG]: React Native Expo, Android OS 에서 지도 최초 로딩시에는 화면이 보이지만 탭이동 또는 router로 화면 이동후 뒤로 돌아 왔을때 맵이 보이지 않는 현상 #175

@VivaInsight

Description

@VivaInsight

Is there an existing issue for this?

  • I have searched the existing issues

Version of @mj-studio/react-native-naver-map

2.6.6

Version of react-native

0.81.5

What os are you seeing the problem on?

Android

What device types are you seeing the problem on?

Physcial Device

What architecture types of react native are you seeing the problem on?

Old Architecture(Bridge)

Version of device(android API, iOS OS version, etc...)

No response

Expo App

  • I am using Expo

What happened?

현재 최신버전 2.6.6 에서 수정된 파일 중 RNCNaverMapViewWrapper.kt 를 보면 기존의 소스코드에서 꽤 많은 부분이 바뀐걸 볼 수 있습니다. 코드를 자세히 보면 기존에 라이프사이클이 변경될때 지도에 대한 상태를 저장해주는데, 변경된 소스 코드에서는 onDetachedFromWindow 가 실행될 때 doDestroy() 를 통해 뷰 자체를 제거하는 걸로 추정됩니다. 따라서 MapView의 Visibility가 visible로 바뀔 수가 없습니다.

이 방법은 아마도 임시방편이겠지만, 저는 doDestroy()를 주석 처리해서 해당 문제를 해결 할 수 있었습니다.

override fun onDetachedFromWindow() {
//if (!destroyed) {
// doDestroy()
//}

super.onDetachedFromWindow()
detachLifecycleObserver()

}

Relevant a package.json.

"dependencies": {
    "@bacons/apple-targets": "^3.0.2",
    "@expo/html-elements": "^0.12.5",
    "@expo/vector-icons": "^15.0.3",
    "@gluestack-ui/core": "^3.0.10",
    "@gluestack-ui/utils": "^3.0.11",
    "@gluestack/ui-next-adapter": "^3.0.3",
    "@gorhom/bottom-sheet": "^5.2.6",
    "@legendapp/motion": "^2.5.3",
    "@mj-studio/react-native-naver-map": "^2.6.6",
    "@react-native-async-storage/async-storage": "2.2.0",
    "@react-native-community/datetimepicker": "8.4.4",
    "@react-native-google-signin/google-signin": "^15.0.0",
    "@react-native-seoul/kakao-login": "^5.4.1",
    "@react-native-seoul/naver-login": "^4.2.2",
    "@react-navigation/bottom-tabs": "^7.3.10",
    "@react-navigation/elements": "^2.3.8",
    "@react-navigation/native": "^7.1.6",
    "ajv": "^8.17.1",
    "axios": "^1.9.0",
    "babel-plugin-module-resolver": "^5.0.2",
    "date-fns": "^4.1.0",
    "es-toolkit": "^1.39.7",
    "expo": "^54.0.23",
    "expo-apple-authentication": "~8.0.7",
    "expo-background-task": "~1.0.8",
    "expo-blur": "~15.0.7",
    "expo-build-properties": "~1.0.9",
    "expo-clipboard": "~8.0.7",
    "expo-constants": "~18.0.10",
    "expo-dev-client": "~6.0.17",
    "expo-device": "~8.0.9",
    "expo-font": "~14.0.9",
    "expo-haptics": "~15.0.7",
    "expo-image": "~3.0.10",
    "expo-image-picker": "~17.0.8",
    "expo-linear-gradient": "~15.0.7",
    "expo-linking": "~8.0.8",
    "expo-location": "~19.0.7",
    "expo-media-library": "~18.2.0",
    "expo-notifications": "~0.32.12",
    "expo-router": "~6.0.14",
    "expo-sensors": "~15.0.7",
    "expo-splash-screen": "~31.0.10",
    "expo-status-bar": "~3.0.8",
    "expo-symbols": "~1.0.7",
    "expo-system-ui": "~6.0.8",
    "expo-task-manager": "~14.0.8",
    "expo-web-browser": "~15.0.9",
    "jwt-decode": "^4.0.0",
    "lucide-react-native": "^0.510.0",
    "nativewind": "^4.1.23",
    "react": "19.1.0",
    "react-dom": "19.1.0",
    "react-native": "0.81.5",
    "react-native-calendars": "^1.1313.0",
    "react-native-css-interop": "^0.2.1",
    "react-native-gesture-handler": "~2.28.0",
    "react-native-gifted-charts": "^1.4.64",
    "react-native-image-viewing": "^0.2.2",
    "react-native-modal-datetime-picker": "^18.0.0",
    "react-native-reanimated": "^4.1.5",
    "react-native-reanimated-carousel": "^4.0.2",
    "react-native-safe-area-context": "^5.6.2",
    "react-native-screens": "~4.16.0",
    "react-native-svg": "^15.13.0",
    "react-native-view-shot": "4.0.3",
    "react-native-web": "^0.21.0",
    "react-native-webview": "13.15.0",
    "react-native-worklets": "0.5.1",
    "tailwindcss": "^3.4.17",
    "toastify-react-native": "^7.2.1",
    "zustand": "^5.0.6"
  },

Relevant log output

Reproducible Sample Repository

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions