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

Ionic Cordova构建Android报错:找不到../pages/Wallet/模块求解决

解决Ionic 3在Ubuntu AWS实例上构建Android时的模块找不到问题

Hey there, let's fix this module not found error you're hitting! The root cause here is actually Linux's case-sensitive file system—something that's easy to miss if you developed this project on Windows (which ignores case in file paths).

What's going wrong?

Looking at your error logs:

  • In app.component.ts, you're importing from ../pages/Wallet/
  • In app.module.ts, you're importing from ../pages/Wallet/wallet

But on your Ubuntu instance, the actual folder is almost certainly named wallet (lowercase), not Wallet (uppercase). Since Linux treats Wallet and wallet as two completely different paths, TypeScript can't locate the module. Removing/re-adding the Android platform won't fix this because it's a file path mismatch, not a Cordova platform issue.

Step-by-step fix

  1. Verify the actual folder name
    Run this command in your project root to check the exact name of the folder:

    ls -la src/pages/
    

    You'll likely see a wallet folder (all lowercase) instead of Wallet.

  2. Fix the import paths
    Update the import statements to match the actual folder's case:

    • In src/app/app.component.ts, change line 12 to:
      import {WalletPage} from '../pages/wallet/';
      
    • In src/app/app.module.ts, change line 15 to:
      import {WalletPage} from '../pages/wallet/wallet';
      
  3. Check for other case mismatches
    Do a quick search across your project to make sure there are no other places where you've used Wallet instead of wallet (like route configurations, other component imports, etc.). You can use this command to find all instances:

    grep -r "../pages/Wallet" src/
    
  4. Clean and rebuild
    Clear any cached build files and try building again:

    ionic cordova clean android
    ionic cordova build android
    

That should resolve the module not found errors—this is a super common gotcha when moving projects from Windows to Linux environments!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 04:15:08