¿Puedo quitar la biblioteca android-support-v4.jar?

Cuando crea un proyecto, viene con esta biblioteca agregada de forma predeterminada:

android-support-v4.jar

¿Puedo quitarlo? ¿Qué sucede si retiro la biblioteca? ¿Puede la aplicación dejar de funcionar en algunos teléfonos?

¿Puedo quitarlo?

Puedes probar.

¿Qué sucede si elimino esa biblioteca?

No podrá utilizar nada suministrado por él, como el backport de fragmentos, ViewPager , etc.

¿Puede la aplicación dejar de funcionar en algunos teléfonos?

Primero obtendrá errores de generación.

Si está usando Eclipse y su proyecto está marcado con un signo de exclamación rojo después de eliminar el tarro android-support-v4, cierre y reinicie Eclipse y debería enderezarlo. (O quizás intente cerrar y volver a abrir el proyecto.)

Puede eliminarlo de forma segura si no utiliza APIs no disponibles para su destino de SDK actual.

Es una biblioteca de soporte. Usted puede leer sobre ello aquí:

  • Configuración de la biblioteca de asistencia

  • Biblioteca de soporte

Puede eliminarlo de forma segura si no utiliza esta API.

Sólo hice eso. Así que tengo varios errores en todos los proyectos, como

 ...\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. ...\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. ...\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. ...\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. ...\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. ...\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. ...\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. 

Esto significa que los recursos mencionados ya no están disponibles para mis proyectos.

Entonces procedí a agregar v7 appcompat , y me dieron no podía deshacerse de mis errores. Por lo tanto, lo borré y borré por error el proyecto del disco, así que instalé los restos (supongo) de él, y esto tampoco terminó bien:

 [2014-12-07 06:25:16 - android-support-v7-gridlayout] Unable to resolve target 'android-7' [2014-12-07 06:25:16 - android-support-v7-mediarouter] Unable to resolve target 'android-17' [2014-12-07 06:25:16 - android-support-v7-palette] Unable to resolve target 'android-7' [2014-12-07 06:25:17 - android-support-v7-gridlayout] Unable to resolve target 'android-7' [2014-12-07 06:25:17 - android-support-v7-palette] Unable to resolve target 'android-7' [2014-12-07 06:25:22 - android-support-v7-mediarouter] Unable to resolve target 'android-17' ...\sdk\extras\android\support\v7\mediarouter\res\values\styles.xml:18: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionButton'. ...\sdk\extras\android\support\v7\mediarouter\res\values\styles.xml:28: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Light.ActionButton'. ...\sdk\extras\android\support\v7\mediarouter\res\values\styles.xml:18: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionButton'. ...\sdk\extras\android\support\v7\mediarouter\res\values\styles.xml:28: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Light.ActionButton'. [2014-12-07 06:25:26 - android-support-v7-mediarouter] 

Así que sí, no lo hagas!

  • Android-support-v4.jar no se importa correctamente en Eclipse
  • ViewPager en un NestedScrollView
  • Android.support.v7.graphics.Palette width and height debe ser> 0
  • Uso de BottomSheetBehavior con un CoordinatorLayout interno
  • Error: El atributo "***" ya se ha definido al utilizar dos proyectos de biblioteca en Android
  • Biblioteca de soporte de Android lanzando una excepción de recursos no encontrados
  • Biblioteca FloatingActionButton de terceros en CoordinatorLayout
  • NotificationBuilder.setProgress no hace nada en 2.3.5
  • Java.lang.RuntimeException: Nombre de animación desconocido: objectAnimator
  • Fragmento con ViewPager dentro de Fragmento y FragmentStatePagerAdapter resultados en Excepción (con ejemplo completo)
  • Soporte para Android (cardView, RecyclerView) en versiones anteriores con kitkat de destino
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.