0

I want to implement google maps in my app.I added a google maps activity and created a key.When using MapsAcivity.java file shown some error codes.I tried many solutions but didn't worked.

MapsAcivity-error code

private GoogleMap mMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

Console error

Task :app:processDebugManifest FAILED

Error: Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:16:5-45:19 to override.

Gustavo Pagani
  • 6,583
  • 5
  • 40
  • 71
udeshan
  • 13
  • 1
  • 4

2 Answers2

0

You are using the appcompat library with androidx library thats why you are having this error. Either use Androidx or Appcompat.

raj kavadia
  • 926
  • 1
  • 10
  • 30
0

You are using material library which is part of AndroidX. If you are not aware of AndroidX, please go through this answer.

Check this https://stackoverflow.com/a/54533702/10877674

Vithani Ravi
  • 1,807
  • 3
  • 13
  • 19