You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ionic 3安装admob-free遇未满足对等依赖问题求助

How to Fix UNMET PEER DEPENDENCIES for @ionic-native/admob-free in Ionic 3

Hey there, let's work through this peer dependency issue step by step — it's rooted in mismatched package versions and conflicting Admob plugins in your project. Here's the breakdown and fix:

Root Causes

Looking at your error logs and package.json:

  • You have two conflicting Admob-related @ionic-native packages: @ionic-native/admob@3.14.0 (a v3 package that requires @ionic-native/core@^3.6.0) and @ionic-native/admob-free@4.5.2 (a v4 package built for v4 core).
  • Your @ionic-native/core@4.4.0 works with v4 packages, but the old v3 admob package is throwing a peer dependency conflict.
  • Minor version mismatches between v4 @ionic-native packages (like admob-free@4.5.2 vs core@4.4.0) can also trigger unmet peer warnings.

Step 1: Remove the conflicting old Admob package

Since you're targeting admob-free, the outdated @ionic-native/admob package is unnecessary and causing conflicts. Remove it with:

npm uninstall --save @ionic-native/admob

Step 2: Align all @ionic-native package versions

For Ionic 3 with v4 @ionic-native, all your @ionic-native packages should share the same version to avoid peer dependency issues. Update your core and other v4 packages to match admob-free@4.5.2:

npm install --save @ionic-native/core@4.5.2 @ionic-native/splash-screen@4.5.2 @ionic-native/status-bar@4.5.2 @ionic-native/launch-navigator@4.5.2

Step 3: Clean cache and do a fresh dependency install

Cached packages can cause unexpected issues, so let's reset and reinstall:

npm cache clean --force
# On Windows, use `rmdir /s /q node_modules` and `del package-lock.json` instead
rm -rf node_modules package-lock.json
npm install

Step 4: Verify the import works

You should now be able to import AdMobFree without errors:

import { AdMobFree } from '@ionic-native/admob-free';

Extra Check

Double-check that your cordova-plugin-admob-free@0.13.0 is compatible with @ionic-native/admob-free@4.5.2 — this version pair works perfectly for Ionic 3 projects.


内容的提问来源于stack exchange,提问作者Darmawansyah

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:52:27