fix: revert Google Services to working config and remove hardcoded Java path

This commit is contained in:
plebeius
2025-08-09 20:16:36 +02:00
parent 390eced823
commit f7df22a504
2 changed files with 5 additions and 18 deletions

View File

@@ -56,24 +56,14 @@ dependencies {
apply from: 'capacitor.build.gradle'
// Google Services plugin - only apply if file exists and has content
// This is wrapped in multiple safety checks to prevent CI failures
try {
def servicesJSON = file('google-services.json')
if (servicesJSON != null && servicesJSON.exists() && servicesJSON.length() > 0) {
try {
// Additional safety check - ensure the plugin is available in classpath
apply plugin: 'com.google.gms.google-services'
println("✓ Google Services plugin applied successfully")
} catch (Exception pluginError) {
println("⚠ Google Services plugin not available or failed to apply: ${pluginError.message}")
println(" This is not a critical error - the app will build without push notifications")
}
if (servicesJSON.exists() && servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
logger.info("google-services.json found, applying Google Services plugin")
} else {
println(" google-services.json not found - building without Google Services")
println(" Push notifications will not be available, but this is not an error")
logger.info("google-services.json not found or empty, Google Services plugin not applied. Push Notifications won't work")
}
} catch(Exception e) {
println(" Google Services check failed: ${e.message}")
println(" Continuing build without Google Services - this is not a critical error")
logger.info("Error checking google-services.json: ${e.message}. Google Services plugin not applied")
}

View File

@@ -26,6 +26,3 @@ android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
android.suppressUnsupportedCompileSdk=35
# Force Gradle to use Java 17 for all operations
org.gradle.java.home=/opt/homebrew/Cellar/openjdk@17/17.0.16/libexec/openjdk.jdk/Contents/Home