Añadir 00-requisitos.md
268
00-requisitos.md.-.md
Normal file
268
00-requisitos.md.-.md
Normal file
@@ -0,0 +1,268 @@
|
|||||||
|
# Requisitos Previos
|
||||||
|
|
||||||
|
Antes de empezar, asegúrate de tener todo esto instalado y configurado.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🐍 Python 3.10+
|
||||||
|
|
||||||
|
### Verificar instalación
|
||||||
|
```bash
|
||||||
|
python --version
|
||||||
|
# Debe mostrar: Python 3.10.x o superior
|
||||||
|
```
|
||||||
|
|
||||||
|
### Instalar (si no lo tienes)
|
||||||
|
|
||||||
|
**Linux/macOS:**
|
||||||
|
```bash
|
||||||
|
sudo apt update && sudo apt install python3 python3-pip # Ubuntu/Debian
|
||||||
|
# o
|
||||||
|
brew install python@3.10 # macOS con Homebrew
|
||||||
|
```
|
||||||
|
|
||||||
|
**Windows:**
|
||||||
|
Descarga desde [python.org](https://www.python.org/downloads/) e instala con "Add to PATH" marcado.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🦋 Flutter 3.44 (o 3.22 LTS)
|
||||||
|
|
||||||
|
### Verificar instalación
|
||||||
|
```bash
|
||||||
|
flutter --version
|
||||||
|
# Debe mostrar: Flutter 3.44.0 o Flutter 3.22.0 (si bajaron versión)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Instalar Flutter
|
||||||
|
|
||||||
|
Sigue la guía oficial: [flutter.dev/get-started/install](https://flutter.dev/get-started/install)
|
||||||
|
|
||||||
|
**Linux/macOS rápido:**
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/flutter/flutter.git -b stable
|
||||||
|
export PATH="$PATH:`pwd`/flutter/bin"
|
||||||
|
flutter doctor
|
||||||
|
```
|
||||||
|
|
||||||
|
**Windows:**
|
||||||
|
Descarga el ZIP desde [flutter.dev](https://flutter.dev), descomprime y agrega `flutter\bin` al PATH.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📦 FVM (Flutter Version Manager) — **RECOMENDADO**
|
||||||
|
|
||||||
|
FVM permite que todos usen exactamente la misma versión de Flutter sin conflictos.
|
||||||
|
|
||||||
|
### Instalar FVM
|
||||||
|
```bash
|
||||||
|
dart pub global activate fvm
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configurar en el proyecto
|
||||||
|
```bash
|
||||||
|
cd basura_app
|
||||||
|
fvm install 3.44.0 # o 3.22.0 según decisión del equipo
|
||||||
|
fvm use 3.44.0
|
||||||
|
```
|
||||||
|
|
||||||
|
Esto crea `.fvm/fvm_config.json` en el repo (debe commitearse).
|
||||||
|
|
||||||
|
### Usar FVM en comandos
|
||||||
|
Prefija todos los comandos con `fvm`:
|
||||||
|
```bash
|
||||||
|
fvm flutter pub get
|
||||||
|
fvm flutter run
|
||||||
|
fvm flutter build apk
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configurar IDE para usar FVM
|
||||||
|
|
||||||
|
**Android Studio:**
|
||||||
|
1. Settings → Languages & Frameworks → Flutter
|
||||||
|
2. Flutter SDK path: `<tu-proyecto>/.fvm/flutter_sdk`
|
||||||
|
|
||||||
|
**VS Code:**
|
||||||
|
1. Abre `.vscode/settings.json`
|
||||||
|
2. Agrega:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"dart.flutterSdkPath": ".fvm/flutter_sdk"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ☕ Java JDK 17 (para Android)
|
||||||
|
|
||||||
|
### Verificar instalación
|
||||||
|
```bash
|
||||||
|
java -version
|
||||||
|
# Debe mostrar: openjdk version "17.x.x"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Por qué Java 17 (y NO 21)
|
||||||
|
Java 21 puede causar problemas con Android Gradle. **Java 17 es el estándar recomendado** para Flutter + Android.
|
||||||
|
|
||||||
|
### Instalar Java 17
|
||||||
|
|
||||||
|
**Linux:**
|
||||||
|
```bash
|
||||||
|
sudo apt install openjdk-17-jdk
|
||||||
|
sudo update-alternatives --config java # selecciona Java 17
|
||||||
|
```
|
||||||
|
|
||||||
|
**macOS:**
|
||||||
|
```bash
|
||||||
|
brew install openjdk@17
|
||||||
|
# Agregar al PATH según instrucciones de Homebrew
|
||||||
|
```
|
||||||
|
|
||||||
|
**Windows:**
|
||||||
|
Descarga desde [Adoptium](https://adoptium.net/temurin/releases/?version=17) e instala.
|
||||||
|
|
||||||
|
### Verificar que Gradle use Java 17
|
||||||
|
```bash
|
||||||
|
cd basura_app/android
|
||||||
|
./gradlew --version
|
||||||
|
# Debería mostrar JVM: 17.x.x
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📱 Android Studio
|
||||||
|
|
||||||
|
Necesario para:
|
||||||
|
- Android SDK
|
||||||
|
- Emuladores
|
||||||
|
- Gradle
|
||||||
|
- Plugin de Flutter/Dart
|
||||||
|
|
||||||
|
### Descargar e instalar
|
||||||
|
[developer.android.com/studio](https://developer.android.com/studio)
|
||||||
|
|
||||||
|
### Configurar después de instalar
|
||||||
|
1. Abrir Android Studio
|
||||||
|
2. Settings → Plugins → instalar **Flutter** y **Dart**
|
||||||
|
3. SDK Manager → instalar **Android SDK Platform API 34** (mínimo)
|
||||||
|
4. AVD Manager → crear un emulador (Pixel 6 / API 34)
|
||||||
|
|
||||||
|
### Aceptar licencias
|
||||||
|
```bash
|
||||||
|
flutter doctor --android-licenses
|
||||||
|
# Escribe "y" a todo
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 Git
|
||||||
|
|
||||||
|
### Verificar instalación
|
||||||
|
```bash
|
||||||
|
git --version
|
||||||
|
# Debe mostrar: git version 2.x.x
|
||||||
|
```
|
||||||
|
|
||||||
|
### Instalar (si no lo tienes)
|
||||||
|
|
||||||
|
**Linux:**
|
||||||
|
```bash
|
||||||
|
sudo apt install git
|
||||||
|
```
|
||||||
|
|
||||||
|
**macOS:**
|
||||||
|
```bash
|
||||||
|
brew install git
|
||||||
|
```
|
||||||
|
|
||||||
|
**Windows:**
|
||||||
|
Descarga desde [git-scm.com](https://git-scm.com/download/win)
|
||||||
|
|
||||||
|
### Configurar credenciales (primera vez)
|
||||||
|
```bash
|
||||||
|
git config --global user.name "Tu Nombre"
|
||||||
|
git config --global user.email "tu@email.com"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🌐 Postman o Thunder Client (opcional)
|
||||||
|
|
||||||
|
Para probar endpoints del backend sin Flutter.
|
||||||
|
|
||||||
|
**Postman:** [postman.com/downloads](https://www.postman.com/downloads/)
|
||||||
|
**Thunder Client:** Extensión de VS Code (más ligero)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ Verificar que todo funciona
|
||||||
|
|
||||||
|
### Backend (Python)
|
||||||
|
```bash
|
||||||
|
python --version
|
||||||
|
pip --version
|
||||||
|
```
|
||||||
|
|
||||||
|
### Flutter
|
||||||
|
```bash
|
||||||
|
flutter doctor -v
|
||||||
|
# Todo debe estar en [✓] excepto opcionales como Xcode (si no estás en macOS)
|
||||||
|
```
|
||||||
|
|
||||||
|
### FVM (si lo instalaste)
|
||||||
|
```bash
|
||||||
|
fvm --version
|
||||||
|
fvm list
|
||||||
|
```
|
||||||
|
|
||||||
|
### Java
|
||||||
|
```bash
|
||||||
|
java -version
|
||||||
|
# Confirmar que es Java 17
|
||||||
|
```
|
||||||
|
|
||||||
|
### Git
|
||||||
|
```bash
|
||||||
|
git --version
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚨 Problemas comunes
|
||||||
|
|
||||||
|
### "flutter: command not found"
|
||||||
|
- Asegúrate que `flutter/bin` esté en tu PATH
|
||||||
|
- Reinicia la terminal después de editar `.bashrc` o `.zshrc`
|
||||||
|
|
||||||
|
### "JAVA_HOME is not set"
|
||||||
|
```bash
|
||||||
|
# Linux/macOS
|
||||||
|
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
|
||||||
|
# (ajusta la ruta según tu instalación)
|
||||||
|
|
||||||
|
# Windows (PowerShell)
|
||||||
|
$env:JAVA_HOME = "C:\Program Files\Java\jdk-17"
|
||||||
|
```
|
||||||
|
|
||||||
|
### "Android licenses not accepted"
|
||||||
|
```bash
|
||||||
|
flutter doctor --android-licenses
|
||||||
|
```
|
||||||
|
|
||||||
|
### FVM no encuentra Flutter
|
||||||
|
```bash
|
||||||
|
# Reinstalar FVM
|
||||||
|
dart pub global deactivate fvm
|
||||||
|
dart pub global activate fvm
|
||||||
|
|
||||||
|
# Reinstalar versión
|
||||||
|
fvm install 3.44.0
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Siguiente paso
|
||||||
|
|
||||||
|
Una vez que todo esté instalado:
|
||||||
|
1. [Configurar el backend](01-backend.md)
|
||||||
|
2. [Configurar Flutter](02-frontend.md)
|
||||||
Reference in New Issue
Block a user