-
Notifications
You must be signed in to change notification settings - Fork 1
Setup & Debugging
ciizerr edited this page Nov 21, 2025
·
1 revision
This is the essential guide for getting the project running and troubleshooting common issues.
- IDE: Android Studio (latest stable version).
- Language: Kotlin (100% codebase).
- Dependencies: Ensure you run Sync Now after adding dependencies for Room, DataStore, and KSP.
Because the app is secured with BuildConfig, a contributor must follow these steps:
- Clone the Repository.
-
Create
local.properties: In the root directory of the project, create this file (it is automatically ignored by Git). -
Add Your Key: Paste your Gemini API key from Google AI Studio into the file:
GEMINI_API_KEY="AIzaSyD...YourActualKeyHere..."
-
Rebuild: Go to Build > Rebuild Project to generate the necessary
BuildConfigfile that makes the key accessible to the app.
If the AI feature fails or the app crashes, use Logcat to diagnose the problem quickly.
-
Filter: In the Logcat window, set your filter to the tag:
GEMINI_DEBUG -
Expected Output: A successful call will show:
Using Key: [DEFAULT or USER CUSTOM] Gemini Replied: Title|HH:mm|DAILY
| Issue | Cause | Solution |
|---|---|---|
| CRASHED: 404 Not Found | The app cannot resolve the model name (e.g., gemini-2.5-flash). |
Check that the model name in GeminiRepository.kt is exactly correct, or temporarily switch to a stable model like gemini-pro. |
| "Save Key" Doesn't Work | The DataStore dependency was missed, or the SettingsSheet isn't fully updated. | Ensure the datastore-preferences dependency is added and synced. Verify the PeaceViewModel is correctly calling settingsManager.saveUserApiKey(). |
| No Internet/Network Error | Missing permission. | Ensure you have <uses-permission android:name="android.permission.INTERNET" /> in your AndroidManifest.xml. |