App technicien : appairage 1x (QR), géorepérage natif en arrière-plan (app fermée) -> checkpoints au hub /field/ts, scan série/MAC on-device MLKit. UI réutilisée depuis le hub (/field). APK Android buildé (debug, 19 Mo, arm64-v8a + armeabi-v7a). - apps/field-tech : Capacitor 6 + Vite ; src/main.js (appairage @capacitor/preferences + BackgroundGeolocation.addGeofences + redirection /field) ; projet android/ avec les 4 correctifs Gradle commités (force work-runtime 2.9.1, minSdk 24, repos maven xms.g + Huawei, googlePlayServicesLocationVersion 21.0.1) ; abiFilters arm (APK 32->19 Mo). - README : recette de build complète (toolchain M4, les 4 fixes, install/appairage) ; BUILD-ANDROID.md (Docker + Android Studio + release signée) ; CI-SETUP.md (runner Gitea). - CI Gitea Actions (.gitea/workflows) : android (runner Linux HORS prod, cache Gradle/npm -> artefact APK) + ios (runner macOS, workflow_dispatch, en attente compte Apple). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
70 lines
2.8 KiB
Groovy
70 lines
2.8 KiB
Groovy
apply plugin: 'com.android.application'
|
||
|
||
android {
|
||
namespace "ca.targo.field"
|
||
compileSdk rootProject.ext.compileSdkVersion
|
||
defaultConfig {
|
||
applicationId "ca.targo.field"
|
||
minSdkVersion rootProject.ext.minSdkVersion
|
||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||
versionCode 1
|
||
versionName "1.0"
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||
ndk {
|
||
// APK terrain = téléphones réels (ARM) uniquement → drop x86/x86_64 (émulateurs Intel/ChromeOS),
|
||
// APK ~2× plus léger. Sur Apple Silicon l'émulateur Android est arm64-v8a → test local OK.
|
||
// Pour un émulateur x86_64, ajouter 'x86_64' ici (ou commenter le bloc).
|
||
abiFilters 'arm64-v8a', 'armeabi-v7a'
|
||
}
|
||
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')
|
||
}
|
||
|
||
// Transistorsoft tire androidx.work 2.10 (exige compileSdk 35) ; on le fixe à 2.9.1 (compat compileSdk 34) → APK debug sideload.
|
||
// (Pour une soumission Play, on passera plutôt compileSdk/targetSdk 35 + AGP 8.7 — voir BUILD-ANDROID.md.)
|
||
configurations.all {
|
||
resolutionStrategy {
|
||
force 'androidx.work:work-runtime:2.9.1'
|
||
force 'androidx.work:work-runtime-ktx:2.9.1'
|
||
}
|
||
}
|
||
|
||
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")
|
||
}
|