Recopilación de errores que he tenido que ir solventado durante el desarrollo en Android
Detectar un error durante el desarrollo es fácil de detectar, simplemente usando el LogCat podremos obtener el reporte de error, o bien cuando la app ya está publicada Google con AndroidVitals nos ofrece reportes de error de los usuarios, de esa forma se puede detectar y solucionar.
Depurar
- Depurar Kotlin, Escribir y ver registros con Logcat
- Separar recursos entre las versiones de lanzamiento y depuración Android Studio
- Añadir archivo de desofuscación para el rastreo de pila de bloqueo GplayConsole
Errores comunes, Error, Warnings y Fixed
- Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6
- Error inflating class com.google.android.material.button.MaterialButton en Android Studio
- Cannot change whether this adapter has stable IDs while the adapter has registered observers
- Permission Denial: startForeground requires android.permission.FOREGROUND_SERVICE
- Error D/NetworkSecurityConfig: No Network Security Config specified, using platform default
- Error java.lang.IllegalStateException: Cannot start this animator on a detached view!
- Error java.lang.RuntimeException: Unable to start activity ComponentInfo usando Navigation Component AndroidX con Kotlin
- Gradle error: To use Coroutine features, you must add ktx artifact from Room as a dependency. androidx.room:room-ktx:<version
- Unable to instantiate fragment androidx.navigation.fragment.NavHostFragment: make sure class name exists
- I/Ads: Ad failed to load : 0
- Moshi+Retrofit Error, Caused by: java.lang.IllegalArgumentException: Platform class java.util.Date (with no annotations) requires explicit JsonAdapter to be registered
- Error The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER
- Error: Unable to get provider androidx.core.content.FileProvider, missing meta-data AndroidX
- Error: Cannot add the same observer with different lifecycles
- Manifest merger failed : android:exported needs to be explicitly specified for element . Apps targeting Android 12
- Error Android: ActivityThread.performLaunchActivity
Deprecated
- Resolver deprecated ViewModelProviders AndroidX Kotlin
- Resolver deprecated: ConnectivityManager.activeNetworkInfo
- ‘setHasOptionsMenu(Boolean): Unit’ is deprecated. Deprecated in Java
Actualizaciones Android Studio
- Solventar problemas del Kotlin Plugin 4.2 en Android Studio
- Actualizar proyectos Android 12(s) API 31