APK hataları

Capacitor sync hatası

Hata metni

[error] Could not find the android platform. Make sure android has been added.
[error] capacitor.config.json not found / webDir "www" does not exist

Neden

cap sync web dosyalarını Android projesine kopyalayamıyor. Android platformu eklenmemiş ya da web build klasörü yok.

Adım adım çözüm

  1. Önce web projesini derle: npm run build. webDir klasörü oluşmalı.
  2. capacitor.config dosyasında webDir'in build çıktı klasörüyle (dist, build) aynı olduğunu kontrol et.
  3. Android yoksa npx cap add android çalıştır.
  4. Sonra npx cap sync android ile dosyaları kopyala.
  5. npx cap doctor ile sürüm uyumsuzluğuna bak.

Örnek komutlar

npm run build
npx cap add android
npx cap sync android
npx cap open android
npx cap doctor

Tekrarlanmasın diye

Her web değişikliğinden sonra build ve sync sırasını tek bir betikte tut.

Yazar ve lisans: Nibras Code