title: No static field navigationView of type I in class Lcom/mapbox/services/android/navigation/ui/v5/R$id
body: <p>Good morning, I have created a new project and I have written the example code to use the browser and it has worked. But now that I try to copy it to my main project does not work for me. The error is as follows:</p>
  
  <blockquote>
    <p>E/AndroidRuntime: FATAL EXCEPTION: main
                      Process: com.apparcago.pacea.firebase2login, PID: 5743
                      java.lang.NoSuchFieldError: No static field navigationView of type I in class Lcom/mapbox/services/android/navigation/ui/v5/R$id; or its superclasses (declaration of 'com.mapbox.services.android.navigation.ui.v5.R$id' appears in /data/app/com.apparcago.pacea.firebase2login-LSC0SaLMEkd-LbroOrauqg==/split_lib_slice_4_apk.apk)
                          at com.mapbox.services.android.navigation.ui.v5.MapboxNavigationActivity.onCreate(MapboxNavigationActivity.java:32)
                          at android.app.Activity.performCreate(Activity.java:7098)
                          at android.app.Activity.performCreate(Activity.java:7089)
                          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2768)
                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2893)
                          at android.app.ActivityThread.-wrap11(Unknown Source:0)
                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
                          at android.os.Handler.dispatchMessage(Handler.java:106)
                          at android.os.Looper.loop(Looper.java:164)
                          at android.app.ActivityThread.main(ActivityThread.java:6650)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:818)</p>
  </blockquote>
  
  <p>I show the code of the project that does not work:</p>
  
  <p><strong><em>Manifest</em></strong></p>
  
  <pre><code>&lt;activity
      android:name=".NavigationActivity"
      android:label="@string/title_activity_navigation"&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p><strong><em>Build.gradle (Module)</em></strong></p>
  
  <pre><code>android {
  buildToolsVersion "27.0.3"
  compileSdkVersion 27
  defaultConfig {
      applicationId "com.apparcago.pacea.firebase2login"
      minSdkVersion 24
      targetSdkVersion 27
      versionCode 1
      versionName "1.0"
      testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }
  
  compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_8
      targetCompatibility JavaVersion.VERSION_1_8
  }
  dependencies {
  implementation fileTree(include: ['*.jar'], dir: 'libs')
  
  
  implementation 'com.android.support:appcompat-v7:27.1.1'
  implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  
  //Firebase
  implementation 'com.google.firebase:firebase-core:16.0.4'
  implementation 'com.google.firebase:firebase-auth:16.0.5'
  implementation 'com.google.firebase:firebase-database:16.0.4'
  
  //Facebook
  implementation 'com.facebook.android:facebook-login:4.38.1'
  
  // Para botones chulos (Fancybuttons)
  implementation 'com.github.medyo:fancybuttons:1.9.0'
  
  //Material design para Dialogs chulos
  implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
  
  //ultima version me da errores
  implementation 'com.google.android.gms:play-services-maps:16.0.0'
  testImplementation 'junit:junit:4.12'
  androidTestImplementation 'com.android.support.test:runner:1.0.2'
  androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
  
  // Material design de editText (Para hacer edit Text bonitos)
  implementation 'com.rengwuxian.materialedittext:library:2.1.4'
  
  //Diseño 27
  implementation 'com.android.support:design:27.1.1'
  
  //Cardview
  implementation 'com.android.support:cardview-v7:27.1.1'
  
  //FAB
  implementation 'com.nightonke:boommenu:2.1.1'
  
  //Mapbox
  //implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:7.0.0-alpha.2'
  implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.7.1'
  implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.23.0'
  
  }
  //Firebase
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p><strong><em>Build.gradle (Project)</em></strong></p>
  
  <pre><code>buildscript {
  
  repositories {
      google()
      jcenter()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:3.1.4'
  
      classpath 'com.google.gms:google-services:4.0.1'
  
      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
  }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          mavenCentral()//Para mapbox
          maven { url 'https://mapbox.bintray.com/mapbox' }
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p><strong><em>Layout</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:mapbox="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".NavigationActivity"&gt;
  
  &lt;com.mapbox.mapboxsdk.maps.MapView
      android:id="@+id/mapView_mapbox"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      mapbox:mapbox_cameraTargetLat="37.7749"
      mapbox:mapbox_cameraTargetLng="-122.4194"
      mapbox:mapbox_cameraZoom="12"
      mapbox:mapbox_styleUrl="mapbox://styles/mapbox/streets-v10" /&gt;
  
  &lt;Button
      android:id="@+id/startButton"
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_marginBottom="24dp"
      android:layout_marginEnd="24dp"
      android:layout_marginStart="24dp"
      android:enabled="false"
      android:text="asd"
      android:textColor="@color/colorPrimary"
      mapbox:layout_constraintBottom_toBottomOf="@+id/mapView_mapbox"
      mapbox:layout_constraintEnd_toEndOf="parent"
      mapbox:layout_constraintStart_toStartOf="parent" /&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p><strong><em>NavigationActivity</em></strong></p>
  
  <pre><code>package com.apparcago.pacea.firebase2login;
  
  import android.location.Location;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.Button;
  import android.widget.Toast;
  
  import com.mapbox.mapboxsdk.geometry.LatLng;
  import com.mapbox.android.core.permissions.PermissionsListener;
  import com.mapbox.android.core.permissions.PermissionsManager;
  import com.mapbox.api.directions.v5.models.DirectionsResponse;
  import com.mapbox.api.directions.v5.models.DirectionsRoute;
  import com.mapbox.geojson.Point;
  import com.mapbox.mapboxsdk.Mapbox;
  import com.mapbox.mapboxsdk.annotations.Marker;
  import com.mapbox.mapboxsdk.annotations.MarkerOptions;
  import com.mapbox.mapboxsdk.location.LocationComponent;
  import com.mapbox.mapboxsdk.location.modes.CameraMode;
  import com.mapbox.mapboxsdk.maps.MapView;
  import com.mapbox.mapboxsdk.maps.MapboxMap;
  import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
  import com.mapbox.services.android.navigation.ui.v5.NavigationLauncher;
  import com.mapbox.services.android.navigation.ui.v5.NavigationLauncherOptions;
  import com.mapbox.services.android.navigation.ui.v5.route.NavigationMapRoute;
  import com.mapbox.services.android.navigation.v5.navigation.NavigationRoute;
  
  import java.util.List;
  
  import retrofit2.Call;
  import retrofit2.Callback;
  import retrofit2.Response;
  
  public class NavigationActivity extends AppCompatActivity implements OnMapReadyCallback, MapboxMap.OnMapClickListener, PermissionsListener {
  private MapView mapView;
  // variables for adding location layer
  private MapboxMap mapboxMap;
  private PermissionsManager permissionsManager;
  private Location originLocation;
  // variables for adding a marker
  private Marker destinationMarker;
  private LatLng originCoord;
  private LatLng destinationCoord;
  // variables for calculating and drawing a route
  private Point originPosition;
  private Point destinationPosition;
  private DirectionsRoute currentRoute;
  private static final String TAG = "DirectionsActivity";
  private NavigationMapRoute navigationMapRoute;
  private Button button;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Mapbox.getInstance(this, getString(R.string.access_token_mapbox));
      setContentView(R.layout.activity_navigation);
      mapView = findViewById(R.id.mapView_mapbox);
      mapView.onCreate(savedInstanceState);
      mapView.getMapAsync(this);
  
  }
  
  @Override
  public void onMapReady(MapboxMap mapboxMap) {
      this.mapboxMap = mapboxMap;
      enableLocationComponent();
      originCoord = new LatLng(originLocation.getLatitude(), originLocation.getLongitude());
      mapboxMap.addOnMapClickListener(this);
      button = findViewById(R.id.startButton);
      button.setOnClickListener(v -&gt; {
          boolean simulateRoute = true;
          NavigationLauncherOptions options = NavigationLauncherOptions.builder()
                  .directionsRoute(currentRoute)
                  .shouldSimulateRoute(simulateRoute)
                  .build();
          // Call this method with Context from within an Activity
          NavigationLauncher.startNavigation(NavigationActivity.this, options);
      });
  }
  
  @Override
  public void onMapClick(@NonNull LatLng point) {
      if (destinationMarker != null) {
          mapboxMap.removeMarker(destinationMarker);
      }
      destinationCoord = point;
      destinationMarker = mapboxMap.addMarker(new MarkerOptions()
              .position(destinationCoord)
      );
      destinationPosition = Point.fromLngLat(destinationCoord.getLongitude(), destinationCoord.getLatitude());
      originPosition = Point.fromLngLat(originCoord.getLongitude(), originCoord.getLatitude());
      getRoute(originPosition, destinationPosition);
      button.setEnabled(true);
      button.setBackgroundResource(R.color.mapboxBlue);
  }
  
  private void getRoute(Point origin, Point destination) {
      NavigationRoute.builder(this)
              .accessToken(Mapbox.getAccessToken())
              .origin(origin)
              .destination(destination)
              .build()
              .getRoute(new Callback&lt;DirectionsResponse&gt;() {
                  @Override
                  public void onResponse(Call&lt;DirectionsResponse&gt; call, Response&lt;DirectionsResponse&gt; response) {
                      // You can get the generic HTTP info about the response
                      Log.d(TAG, "Response code: " + response.code());
                      if (response.body() == null) {
                          Log.e(TAG, "No routes found, make sure you set the right user and access token.");
                          return;
                      } else if (response.body().routes().size() &lt; 1) {
                          Log.e(TAG, "No routes found");
                          return;
                      }
  
                      currentRoute = response.body().routes().get(0);
  
                      // Draw the route on the map
                      if (navigationMapRoute != null) {
                          navigationMapRoute.removeRoute();
                      } else {
                          navigationMapRoute = new NavigationMapRoute(null, mapView, mapboxMap, R.style.NavigationMapRoute);
                      }
                      navigationMapRoute.addRoute(currentRoute);
                  }
  
                  @Override
                  public void onFailure(Call&lt;DirectionsResponse&gt; call, Throwable throwable) {
                      Log.e(TAG, "Error: " + throwable.getMessage());
                  }
              });
  }
  @SuppressWarnings( {"MissingPermission"})
  private void enableLocationComponent() {
      // Check if permissions are enabled and if not request
      if (PermissionsManager.areLocationPermissionsGranted(this)) {
          // Activate the MapboxMap LocationComponent to show user location
          // Adding in LocationComponentOptions is also an optional parameter
          LocationComponent locationComponent = mapboxMap.getLocationComponent();
          locationComponent.activateLocationComponent(this);
          locationComponent.setLocationComponentEnabled(true);
          // Set the component's camera mode
          locationComponent.setCameraMode(CameraMode.TRACKING);
          Location lastLocation = locationComponent.getLastKnownLocation();
          originLocation = locationComponent.getLastKnownLocation();
  
      } else {
          permissionsManager = new PermissionsManager(this);
          permissionsManager.requestLocationPermissions(this);
      }
  }
  
  @Override
  public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
      permissionsManager.onRequestPermissionsResult(requestCode, permissions, grantResults);
  }
  
  @Override
  public void onExplanationNeeded(List&lt;String&gt; permissionsToExplain) {
      Toast.makeText(this, "PRUEBA1", Toast.LENGTH_LONG).show();
  }
  
  @Override
  public void onPermissionResult(boolean granted) {
      if (granted) {
          enableLocationComponent();
      } else {
          Toast.makeText(this, "PERMISOS NO ACEPTADOS", Toast.LENGTH_LONG).show();
          finish();
      }
  }
  
  @Override
  protected void onStart() {
      super.onStart();
      mapView.onStart();
  }
  
  @Override
  protected void onResume() {
      super.onResume();
      mapView.onResume();
  }
  
  @Override
  protected void onPause() {
      super.onPause();
      mapView.onPause();
  }
  
  @Override
  protected void onStop() {
      super.onStop();
      mapView.onStop();
  }
  
  @Override
  protected void onSaveInstanceState(Bundle outState) {
      super.onSaveInstanceState(outState);
      mapView.onSaveInstanceState(outState);
  }
  
  @Override
  protected void onDestroy() {
      super.onDestroy();
      mapView.onDestroy();
  }
  
  @Override
  public void onLowMemory() {
      super.onLowMemory();
      mapView.onLowMemory();
  }
  
  }
  </code></pre>
  
  <p>The only difference in the project that works is that it has fewer dependencies since it is a project created only to learn mapbox.</p>
  
  <p>I will not find the error, but I think it may be related to the gradle, any suggestions?</p>
  
  <p>Sorry for the tirade and for my English, and thanks in advance.</p>