Init Android platform via cap add android

Génère la structure Capacitor Android (gradle + manifest + activity Java/Kotlin)
avec applicationId 'ch.hypnotruck.coach' (cohérent avec iOS), minSdk 24, target 36.

8 plugins synchronisés au passage (déjà déclarés dans package.json) :
@capacitor/{app,geolocation,haptics,local-notifications,push-notifications,
splash-screen,status-bar} et @capgo/capacitor-health.

Build APK toujours bloqué côté infra (Android SDK non installé sur cette machine,
+ attente validation Play Console pour signing/upload). Mais la structure est
prête : `cap sync` après modification du web puis `./gradlew assembleDebug`
sur une machine avec Android SDK.

Étape suivante : configurer permissions Health Connect dans AndroidManifest +
sync iOS pour cohérence cross-platform.
This commit is contained in:
Sylvain Bettinelli
2026-05-07 16:26:30 +00:00
parent a7809992a9
commit 7818f7b663
55 changed files with 1020 additions and 0 deletions

54
android/app/build.gradle Normal file
View File

@@ -0,0 +1,54 @@
apply plugin: 'com.android.application'
android {
namespace = "ch.hypnotruck.coach"
compileSdk = rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "ch.hypnotruck.coach"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
implementation project(':capacitor-android')
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
}
apply from: 'capacitor.build.gradle'
try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}