com.marianhello.bgloc.sync.AuthenticatorService error con Android 12
Opened this issue · 0 comments
Error al correr aplicacion en dispositivo fisico con las plataforma Ionic 6 y Capacitor 4 Al instalar y configurar (https://github.com/mauron85/cordova-plugin-background-geolocation)
Your Environment
Ionic:
Ionic CLI : 6.20.3
Ionic Framework : @ionic/angular 6.3.0
@angular-devkit/build-angular : 14.2.5
@angular-devkit/schematics : 14.2.5
@angular/cli : 14.2.5
@ionic/angular-toolkit : 6.1.0
Capacitor:
Capacitor CLI : 4.3.0
@capacitor/android : 4.3.0
@capacitor/core : 4.3.0
@capacitor/ios : not installed
Utility:
cordova-res : 0.15.4
native-run : 1.7.1
System:
NodeJS : v16.13.1 (C:\Program Files\nodejs\node.exe)
npm : 8.1.2
OS : Windows 10
- Plugin version: ultima version
- Platform: Android
- OS version: Windows 10
- Device manufacturer and model:
- Running in Simulator: no
- Cordova version (
cordova -v
): - Cordova platform version (
cordova platform ls
): - Plugin configuration options:
- Link to your project:
Context
la aplicacion crea una carpeta capacitor-cordova-android-plugins, donde se integran todos los plugins instalados y un manifest que muestra el error en
service android:name="com.marianhello.bgloc.sync.AuthenticatorService
no tiene el android:exported="false" , que es requerido para Android 12
Expected Behavior
La aplicacion deberia correr sin problemas e instalarse en el despositivo fisico.
Actual Behavior
[ng] ✔ Browser application bundle generation complete.
[ng] 66 unchanged chunks
[ng]
[ng] Build at: 2022-10-07T18:49:04.647Z - Hash: 1c74ee30b52e8a1a - Time: 643ms
[ng] √ Compiled successfully.
[ng] ✔ Browser application bundle generation complete.
[ng] 66 unchanged chunks
[ng]
[ng] Build at: 2022-10-07T18:49:05.312Z - Hash: 1c74ee30b52e8a1a - Time: 548ms
[ng] √ Compiled successfully.
[capacitor] × Running Gradle build - failed!
[capacitor] [error]
[capacitor] > Configure project :app
[capacitor] WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats.
[capacitor]
[capacitor] > Configure project :capacitor-cordova-android-plugins
[capacitor] WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats.
[capacitor]
[capacitor] > Task :app:preBuild UP-TO-DATE
[capacitor] > Task :app:preDebugBuild UP-TO-DATE
[capacitor] > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
[capacitor] > Task :capacitor-android:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-android:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-android:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-app:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-app:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-app:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-cordova-android-plugins:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-cordova-android-plugins:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-cordova-android-plugins:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-geolocation:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-geolocation:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-geolocation:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-haptics:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-haptics:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-haptics:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-keyboard:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-keyboard:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-keyboard:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-status-bar:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-status-bar:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-status-bar:compileDebugAidl NO-SOURCE
[capacitor] > Task :app:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-android:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-app:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-cordova-android-plugins:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-geolocation:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-haptics:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-keyboard:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-status-bar:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :app:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :app:generateDebugBuildConfig UP-TO-DATE
[capacitor] > Task :app:javaPreCompileDebug UP-TO-DATE
[capacitor] > Task :capacitor-android:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-app:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-geolocation:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-haptics:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-keyboard:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-status-bar:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :app:generateDebugResValues UP-TO-DATE
[capacitor] > Task :app:generateDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-cordova-android-plugins:writeDebugAarMetadata
[capacitor] > Task :capacitor-android:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-android:generateDebugResValues UP-TO-DATE
[capacitor] > Task :capacitor-android:generateDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-android:packageDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-app:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-app:generateDebugResValues UP-TO-DATE
[capacitor] > Task :capacitor-app:generateDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-app:packageDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-cordova-android-plugins:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-cordova-android-plugins:generateDebugResValues
[capacitor] > Task :capacitor-cordova-android-plugins:generateDebugResources
[capacitor] > Task :capacitor-cordova-android-plugins:packageDebugResources
[capacitor] > Task :capacitor-geolocation:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-geolocation:generateDebugResValues UP-TO-DATE
[capacitor] > Task :capacitor-geolocation:generateDebugResources UP-TO-DATE
[capacitor] - https://repo.maven.apache.org/maven2/com/intentfilter/android-permissions/0.1.7/android-permissions-0.1.7.pom
[capacitor] - file:/C:/simplexity/testApps/permAndroid/android/capacitor-cordova-android-plugins/src/main/libs/android-permissions-0.1.7.jar
[capacitor] - file:/C:/simplexity/testApps/permAndroid/android/capacitor-cordova-android-plugins/src/main/libs/android-permissions.jar
[capacitor] - file:/C:/simplexity/testApps/permAndroid/android/app/libs/android-permissions-0.1.7.jar
[capacitor] - file:/C:/simplexity/testApps/permAndroid/android/app/libs/android-permissions.jar
[capacitor] Required by:
[capacitor] project :app
[capacitor] project :app > project :capacitor-cordova-android-plugins
[capacitor]
[capacitor] * Try:
[capacitor] > Run with --stacktrace option to get the stack trace.
[capacitor] > Run with --info or --debug option to get more log output.
[capacitor] > Run with --scan to get full insights.
[capacitor]
[capacitor] * Get more help at https://help.gradle.org
[capacitor]
[capacitor] BUILD FAILED in 4s
[capacitor] 21 actionable tasks: 4 executed, 17 up-to-date
[capacitor]
[ERROR] An error occurred while running subprocess capacitor.
capacitor.cmd run android --no-sync --target d3af63f5 exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Pero genera un error con SDK para Android 12
Possible Fix
Por el momento la solucion es inyectar manualmente (android:exported="true"), y cada vez que se corra la aplicacion o se genere Apk con android studio
- Instalar Ionic y Capacitor en ultimas versiones
2.Instalar plugin desde IONIC (https://ionicframework.com/docs/native/background-geolocation)
3.Instalar android para capacitor (npm install @capacitor/android)
4.agregar plataforma de android(npx cap add android)
5.Corres la aplicacion con los comandos indicados
npx jetify
ionic build –prod
npx cap sync android
ionic cap sync android
ionic capacitor run android -l --external
Context
deboinsertar manualmente el (android:exported="true"), y esto pone lento el proceso de trabajo