udeshan
udeshan

Reputation: 13

error in implement google maps default mapsactivity

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.

Upvotes: 0

Views: 97

Answers (2)

Vithani Ravi
Vithani Ravi

Reputation: 1981

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

Upvotes: 0

raj kavadia
raj kavadia

Reputation: 1073

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

Upvotes: 0

Related Questions