Expo环境下React Native中Naver Map无法显示的问题求助
我正在学习React Native Expo环境,尝试集成@mj-studio/react-native-naver-map提供的Naver Map,但地图在模拟器中无法显示。根据文档说明,在app.config.js中添加插件后执行npx expo prebuild,依赖应该自动配置到Android项目,但我的配置未生效,手动调整也未能解决问题。以下是相关配置内容、模拟器截图及完整代码仓库信息,恳请帮忙排查解决。
app.config.js 插件配置
plugins: [ [ "@mj-studio/react-native-naver-map", { client_id: process.env.NAVER_CLIENT_ID, android: { ACCESS_FINE_LOCATION: true, ACCESS_COARSE_LOCATION: true, ACCESS_BACKGROUND_LOCATION: true, }, }, ], "expo-router", [ "expo-splash-screen", { image: "./assets/images/splash-icon.png", imageWidth: 200, resizeMode: "contain", backgroundColor: "#ffffff", }, ], [ "expo-location", { locationAlwaysAndWhenInUsePermission: "Allow $(PRODUCT_NAME) to use your location.", }, ], [ "expo-build-properties", { android: { extraMavenRepos: ["https://repository.map.naver.com/archive/maven"], }, }, ], ],
android/build.gradle 配置
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { buildToolsVersion = findProperty('android.buildToolsVersion') ?: '35.0.0' minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '24') compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '35') targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34') kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.25' ndkVersion = "26.1.10909125" } repositories { google() mavenCentral() } dependencies { classpath('com.android.tools.build:gradle') classpath('com.facebook.react:react-native-gradle-plugin') classpath('org.jetbrains.kotlin:kotlin-gradle-plugin') } } apply plugin: "com.facebook.react.rootproject" allprojects { repositories { maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android')) } maven { // Android JSC is installed from npm url(new File(['node', '--print', "require.resolve('jsc-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), '../dist')) } google() mavenCentral() maven { url 'https://www.jitpack.io' } } }
模拟器截图

完整代码仓库
https://github.com/WhereToGo-Personal/FrontEnd-ReactNative
感谢您的帮助!
内容的提问来源于stack exchange,提问作者10cm_Mocha
相关产品推荐
相关产品推荐

