mapbox / mapbox/mapbox-navigation-android-examples
Unresolved reference:databinding
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Kotlin
- Estrellas
- 65
- Forks
- 56
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 2
Descripción
Hi,
I am trying to use the turn-by-turn navigation example, but I cannot resolve the reference:
import com.mapbox.navigation.examples.databinding.MapboxActivityTurnByTurnExperienceBinding
I am having a hard time just to fix this. Could anyone help me, please?
Here is gradle (project):
buildscript {
ext.kotlin_version = '1.7.20-RC'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
username = "mapbox"
password = System.getenv("MAPBOX_DOWNLOADS_TOKEN") ?: project.property("MAPBOX_DOWNLOADS_TOKEN") as String
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle (app)
plugins {
id 'com.android.application'
}
apply plugin: 'kotlin-android'
android {
compileSdk 32
defaultConfig {
applicationId "com.example.android.testenavegacao"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
viewBinding true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
def srcDirs = file("$projectDir/src/main/java/com/mapbox/navigation/examples")
.listFiles({ it.isDirectory() } as FileFilter)
.collect { it.name }
res.srcDirs = ['src/main/res']
srcDirs.forEach {
res.srcDirs += 'src/main/java/com/mapbox/navigation/examples/' + it + '/res'
}
}
}
configurations {
all*.exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-telemetry'
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'androidx.core:core:1.8.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'com.google.firebase:firebase-crashlytics-buildtools:2.9.1'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.android.libraries.maps:maps:3.1.0-beta'
implementation 'com.google.firebase:firebase-config:21.1.1'
implementation 'androidx.databinding:databinding-adapters:7.2.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "androidx.core:core-ktx:1.8.0"
implementation "com.google.android.gms:play-services-location:20.0.0"
implementation "androidx.multidex:multidex:2.0.1"
implementation "com.squareup.leakcanary:leakcanary-android:2.8.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1"
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.mapbox.maps:android:10.7.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-core:5.0.2'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.11.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:6.7.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.7.0'
/ Mapbox Navigation Android Auto SDK Developer Preview /
implementation("com.mapbox.navigation:ui-androidauto:0.8.0")
implementation "com.mapbox.navigation:ui-dropin:2.7.0"
implementation "com.mapbox.navigation:android:2.7.0"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.6'
implementation "androidx.core:core-ktx:+"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.0.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}
settings.gradle
dependencyResolutionManagement {
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be mapbox (not your username).
username = "mapbox"
// Use the secret token you stored in gradle.properties as the password
password = "pass-"
}
}
}
}
}
rootProject.name = "testenavegacao"
include ':app'
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con app/build.gradle y settings.gradle, y luego inspecciona la configuración de viewBinding y sourceSets junto con el import generado de MapboxActivityTurnByTurnExperienceBinding. Ejecuta una sincronización/build de Gradle para identificar por qué no se genera la referencia; se considera terminado cuando el ejemplo compila con la referencia al binding resuelta.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- android, kotlin
- Área
- build-system, mobile
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100