Code Monkey home page Code Monkey logo

Comments (5)

spaceod avatar spaceod commented on June 2, 2024 12

Replace the code with ./node_modules/@homee/react-native-mapbox-navigation/android/build.gradle

// android/build.gradle

def DEFAULT_COMPILE_SDK_VERSION = 33
def DEFAULT_BUILD_TOOLS_VERSION = '31.0.0'
def DEFAULT_MIN_SDK_VERSION = 24
def DEFAULT_TARGET_SDK_VERSION = 33

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'

buildscript {
ext.kotlin_version = '1.6.20'
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
if (project == rootProject) {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
}
}

repositories {
    mavenCentral()
}

dependencies {
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'

android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}

repositories {
// ref: https://www.baeldung.com/maven-local-repository
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
// Android JSC is installed from npm
url "$rootDir/../node_modules/jsc-android/dist"
}
google()
jcenter()
}

dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
implementation 'com.mapbox.navigation:core:1.5.0'
implementation 'com.mapbox.navigation:ui:1.5.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

def configureReactNativePom(def pom) {
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)

pom.project {
    name packageJson.title
    artifactId packageJson.name
    version = packageJson.version
    group = "com.homee.mapboxnavigation"
    description packageJson.description
    url packageJson.repository.baseUrl

    licenses {
        license {
            name packageJson.license
            url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
            distribution 'repo'
        }
    }
}

}

afterEvaluate { project ->
android.libraryVariants.all { variant ->
def name = variant.name.capitalize()
def javaCompileTask = variant.javaCompileProvider.get()

    task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
        from javaCompileTask.destinationDir
    }
}

}

from react-native-mapbox-navigation.

aradhya-gupta avatar aradhya-gupta commented on June 2, 2024

Facing the same issue on Android.
This issue has already been addressed ig.
#67

from react-native-mapbox-navigation.

amritk avatar amritk commented on June 2, 2024

@spaceod you are a legend! Many thanks

from react-native-mapbox-navigation.

mckeny3 avatar mckeny3 commented on June 2, 2024

you save the day bro...was just thinking to create one from scratch!

from react-native-mapbox-navigation.

domingoladron avatar domingoladron commented on June 2, 2024

Sorry, I'm new to all this. What exactly am I replacing here?

from react-native-mapbox-navigation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.