Update Build ENV Variable - #115
Conversation
✅ Deploy Preview for tani-pintar ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughAdds an API_URL BuildConfig field sourced from EXPO_PUBLIC_API_URL (with a fallback). Updates AndroidManifest: removes package attribute, disables Expo Updates, removes related metadata, and adjusts deep link schemes. Removes a redundant AppTheme style. Deletes expo.jsEngine property from gradle.properties. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Android
participant App
participant ExpoUpdates as Expo Updates
User->>Android: Launch app
Android->>App: onCreate()
App->>ExpoUpdates: Check if updates enabled
ExpoUpdates-->>App: Disabled (false)
App-->>User: Continue normal startup
sequenceDiagram
participant Env as Build Env
participant Gradle
participant BuildConfig
participant App
Env-->>Gradle: EXPO_PUBLIC_API_URL (or unset)
Gradle->>BuildConfig: Generate API_URL (fallback if unset)
App->>BuildConfig: Read API_URL at runtime
BuildConfig-->>App: Return API_URL string
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
android/app/build.gradle (1)
98-99: Harden BuildConfig.API_URL resolution and escape quotesThe current buildConfigField works, but:
- System.getenv is read at Gradle config time; Android Studio builds often don’t inherit shell envs. Prefer also checking Gradle properties (-P) or gradle.properties for local dev.
- If the env value contains a double quote, the generated Java string would be malformed. Escape quotes before embedding.
Apply this diff to make resolution more robust and safe:
- // Inject environment variables as BuildConfig fields - buildConfigField "String", "API_URL", "\"${System.getenv('EXPO_PUBLIC_API_URL') ?: 'https://dev.api.taniverse.id'}\"" + // Inject environment variables as BuildConfig fields (env -> -P prop -> fallback) + def rawApiUrl = (System.getenv('EXPO_PUBLIC_API_URL') + ?: findProperty('EXPO_PUBLIC_API_URL') + ?: 'https://dev.api.taniverse.id') + // Escape any quotes to keep the generated Java valid + def safeApiUrl = rawApiUrl.replace('"', '\\"') + buildConfigField "String", "API_URL", "\"${safeApiUrl}\""
- Confirm your CI and local Android Studio builds provide EXPO_PUBLIC_API_URL (either via env or gradle.properties/–P). If you want, I can add a small guard that fails release builds when the URL is unset to avoid shipping with the dev fallback.
android/app/src/main/AndroidManifest.xml (1)
17-19: Updates disabled — consider pruning redundant metadataSetting expo.modules.updates.ENABLED to false is sufficient. Leaving EXPO_UPDATES_CHECK_ON_LAUNCH and EXPO_UPDATES_LAUNCH_WAIT_MS is harmless but confusing since they’re ignored when disabled. Prune to reduce config noise.
Apply this diff to remove the unused metadata:
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/> - <meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/> - <meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (15)
android/app/src/main/res/mipmap-hdpi/ic_launcher.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-hdpi/ic_launcher_round.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-mdpi/ic_launcher.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-mdpi/ic_launcher_round.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-xhdpi/ic_launcher.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-xhdpi/ic_launcher_round.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-xxhdpi/ic_launcher.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-xxxhdpi/ic_launcher.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.pngis excluded by!**/*.pngandroid/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.pngis excluded by!**/*.png
📒 Files selected for processing (4)
android/app/build.gradle(1 hunks)android/app/src/main/AndroidManifest.xml(2 hunks)android/app/src/main/res/values/styles.xml(0 hunks)android/gradle.properties(1 hunks)
💤 Files with no reviewable changes (1)
- android/app/src/main/res/values/styles.xml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - tani-pintar
- GitHub Check: Header rules - tani-pintar
- GitHub Check: Pages changed - tani-pintar
🔇 Additional comments (4)
android/gradle.properties (1)
59-59: Edge-to-edge flag left disabled — verify UX and status bar insetsexpo.edgeToEdgeEnabled=false is fine, just ensure your theme/window insets handling matches this choice (status/navigation bars, splash screen background). If you intended to move toward edge-to-edge on Android 13+, you’ll want this true with proper WindowInsets handling.
Also noting the removal of expo.jsEngine (as per PR context) aligns with hermesEnabled=true in app/build.gradle — good cleanup.
Do you want to keep edge-to-edge off for now? If not, I can draft the minimal changes (theme and activity window flags) to enable it safely.
android/app/src/main/AndroidManifest.xml (3)
1-1: Removing package from is correct with AGP namespaceGood move. With namespace set in build.gradle (namespace 'com.taniverse.tanipintar'), keeping the package attribute in the manifest is deprecated.
20-31: Deep link scheme reduced to only “myapp” — verify no regressionsYou removed the com.taniverse.tanipintar scheme (per PR), leaving only myapp. If any existing links/QRs/Intents rely on the old scheme, they will break. Consider keeping both schemes for backward compatibility during a transition period.
I can add back the second tag if needed:
<intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:scheme="myapp"/> + <data android:scheme="com.taniverse.tanipintar"/> </intent-filter>
16-16: Ensure @style/AppTheme still exists after styles cleanupManifest references android:theme="@style/AppTheme". Given styles were adjusted in this PR, double-check that AppTheme is still defined to avoid a runtime resource crash on launch.
If AppTheme was renamed, update the manifest theme or re-add a forwarder style. I can draft the minimal styles.xml entry if needed.
Summary by CodeRabbit
New Features
Chores
Refactor