Giter VIP home page Giter VIP logo

Comments (24)

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024 1

Can you see my manifest file where I can move the meta value please ?
And I will see if it works or not and I will try to find solution for it and share the solution if I found it.
Here is the file
https://github.com/Youssef-Durgham/alnajaf-taxi-app-zaid-master-new/blob/master/android/app/src/main/AndroidManifest.xml

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

same problem please if you find a solve told me and I will do the same.

from react-native-mapbox-navigation.

mckeny3 avatar mckeny3 commented on June 4, 2024

Use dropin ui from mapbox...then use native view manager to display it

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

Use dropin ui from mapbox...then use native view manager to display it

sorry for the asking but can you provide me a clear answer and I will be Grateful for you

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024
Screenshot 2023-05-24 at 11 59 14 PM

and when I return from the map screen to the Home Screen I got this error

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

this is my example code
https://github.com/Youssef-Durgham/alnajaf-taxi-app-zaid-master-new
I don't know how to do it
it take from me 48h and didn't fixed the mapbox code is inside screen folder in CaptainInfoScreen.js

from react-native-mapbox-navigation.

NidheeshVgopal avatar NidheeshVgopal commented on June 4, 2024

Hi,
My above issue got fixed when give the meta value inside Application tag of AndroidManifest.xml.
But after this, app is getting crash on launch. This is the error on logcat :

E/AndroidRuntime: FATAL EXCEPTION: MapboxTelemetryExecutor
Process: com.my_project, PID: 4855
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/my_project/android/core/FileUtils;

another issue is ::=>

E/Mbgl-Mapbox: Error occurred while initializing telemetry
java.lang.IllegalArgumentException: com.my_project: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:401)

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

I think it most be outside activity i will try now

from react-native-mapbox-navigation.

NidheeshVgopal avatar NidheeshVgopal commented on June 4, 2024

The crash issue was solved. But still getting the blank map on Android.

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

I found the solution can you share to me the way you add the <meta-data in the AndroidManifest.xml

from react-native-mapbox-navigation.

NidheeshVgopal avatar NidheeshVgopal commented on June 4, 2024

"





 <meta-data android:name="MAPBOX_DOWNLOADS_TOKEN"
android:value="mapbox_secret_token" />
</application>

inside , after "

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

Yeah you should do it like that
<meta-data android:name="MAPBOX_ACCESS_TOKEN" android:value="here add your public token not the private token" />
copy and paste it and told me what you get

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

Add to it the public token and the android:name should be MAPBOX_ACCESS_TOKEN

from react-native-mapbox-navigation.

NidheeshVgopal avatar NidheeshVgopal commented on June 4, 2024

Now app crashes 2-3 sec after launch.

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024
Screenshot 2023-05-25 at 8 36 06 AM it works with me with this way but with a blue map with the Mapbox logo but it not show the directions try to change the build.gradle for this library inside module be copy and past all of this instead of the old `

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.

NidheeshVgopal avatar NidheeshVgopal commented on June 4, 2024

Screenshot 2023-05-25 at 8 36 06 AM it works with me with this way but with a blue map with the Mapbox logo but it not show the directions try to change the build.gradle for this library inside module be copy and past all of this instead of the old `
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
}

} }`

when I added this I got the Duplicate class com.mapbox.android.core.location.... error. How did u fixed this. i was fixed this issue, by changing the implements in the same file? is there any other option?

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

In the build.gradle in the app level add this below inside dependencies

implementation "com.mapbox.mapboxsdk:mapbox-android-core:5.0.0" 
implementation('com.mapbox.mapboxsdk:mapbox-android-core:5.0.0') {
        exclude group: 'com.mapbox.common', module: 'common'
}

and if you have an old implementation for mapbox delete them

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

And told me will you get a blue screen like mine with the mapbox logo or it will show the directions

from react-native-mapbox-navigation.

NidheeshVgopal avatar NidheeshVgopal commented on June 4, 2024

In the build.gradle in the app level add this below inside dependencies

implementation "com.mapbox.mapboxsdk:mapbox-android-core:5.0.0" 
implementation('com.mapbox.mapboxsdk:mapbox-android-core:5.0.0') {
        exclude group: 'com.mapbox.common', module: 'common'
}

and if you have an old implementation for mapbox delete them

Duplicate class com.mapbox.android.core.location.LocationEngine issue is not got resolved.
I have added the above inside my project/android/app/build.gradle inside depenedencies

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

I fix it by this way I don’t know try to search for it

from react-native-mapbox-navigation.

mckeny3 avatar mckeny3 commented on June 4, 2024

`package com.mckenytech.swyfiodriver
import android.location.Location
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.mckenytech.swyfiodriver.databinding.MapboxActivityNavigationViewBinding
import com.mapbox.api.directions.v5.models.RouteOptions
import com.mapbox.geojson.Point
import com.mapbox.maps.MapView
import com.mapbox.maps.plugin.gestures.OnMapLongClickListener
import com.mapbox.maps.plugin.gestures.gestures
import com.mapbox.navigation.base.extensions.applyDefaultNavigationOptions
import com.mapbox.navigation.base.extensions.applyLanguageAndVoiceUnitOptions
import com.mapbox.navigation.base.route.NavigationRoute
import com.mapbox.navigation.base.route.NavigationRouterCallback
import com.mapbox.navigation.base.route.RouterFailure
import com.mapbox.navigation.base.route.RouterOrigin
import com.mapbox.navigation.core.lifecycle.MapboxNavigationApp
import com.mapbox.navigation.core.trip.session.LocationMatcherResult
import com.mapbox.navigation.core.trip.session.LocationObserver
import com.mapbox.navigation.dropin.NavigationView
import com.mapbox.navigation.dropin.map.MapViewObserver
import com.mapbox.navigation.utils.internal.ifNonNull
import com.mapbox.navigation.utils.internal.logD

/**

  • The example demonstrates how to use [MapboxNavigationApp] to request routes outside [NavigationView]

  • and transition [NavigationView] to active navigation state.

  • Before running the example make sure you have put your access_token in the correct place

  • inside [app-preview/src/main/res/values/mapbox_access_token.xml]. If not present then add

  • this file at the location mentioned above and add the following content to it

  • <string name="mapbox_access_token"><PUT_YOUR_ACCESS_TOKEN_HERE></string>
    
  • The example uses replay location engine to facilitate navigation without physically moving.

  • How to use the example:

    • Start the example
    • Grant the location permissions if not already granted
    • Long press anywhere on the map
    • NavigationView should transition to active guidance
      */
      class NavigationViewActivity : AppCompatActivity(), OnMapLongClickListener {
      private var destination: Point? = null

    private var lastLocation: Location? = null
    private lateinit var binding: MapboxActivityNavigationViewBinding

    /**

    • Gets notified with location updates.

    • Exposes raw updates coming directly from the location services

    • and the updates enhanced by the Navigation SDK (cleaned up and matched to the road).
      */
      private val locationObserver = object : LocationObserver {
      override fun onNewLocationMatcherResult(locationMatcherResult: LocationMatcherResult) {
      lastLocation = locationMatcherResult.enhancedLocation
      }

      override fun onNewRawLocation(rawLocation: Location) {
      // no impl
      }
      }

    /**

    • Notifies with attach and detach events on [MapView]
      */
      private val mapViewObserver = object : MapViewObserver() {
      override fun onAttached(mapView: MapView) {
      mapView.gestures.addOnMapLongClickListener(
      this@NavigationViewActivity
      )
      }

      override fun onDetached(mapView: MapView) {
      mapView.gestures.removeOnMapLongClickListener(
      this@NavigationViewActivity
      )
      }
      }

    override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    val longitude = intent.getDoubleExtra("longitude", 0.0)
    val latitude = intent.getDoubleExtra("latitude", 0.0)
    destination = Point.fromLngLat(longitude, latitude)
    binding = MapboxActivityNavigationViewBinding.inflate(layoutInflater)
    setContentView(binding.root)

     // Set to false if you want to handle map long click listener in the app
     binding.navigationView.customizeViewOptions {
         enableMapLongClickIntercept = false
     }
    
     binding.navigationView.registerMapObserver(mapViewObserver)
     MapboxNavigationApp.current()?.registerLocationObserver(locationObserver)
    

// binding.startTripButton.setOnClickListener {
// ifNonNull(lastLocation, destination) { origin, destination ->
// requestRoutes(Point.fromLngLat(origin.longitude, origin.latitude), destination)
// }
// }

}

override fun onDestroy() {
    super.onDestroy()
    binding.navigationView.unregisterMapObserver(mapViewObserver)
    MapboxNavigationApp.current()?.unregisterLocationObserver(locationObserver)
}

override fun onMapLongClick(point: Point): Boolean {
    ifNonNull(lastLocation, destination) { origin, destination ->
        requestRoutes(Point.fromLngLat(origin.longitude, origin.latitude), destination)
        //log
        logD("origin: ${origin.longitude}, ${origin.latitude}")
    }
    return true
}

private fun requestRoutes(origin: Point, destination: Point) {
    MapboxNavigationApp.current()!!.requestRoutes(
        routeOptions = RouteOptions
            .builder()
            .applyDefaultNavigationOptions()
            .applyLanguageAndVoiceUnitOptions(this)
            .coordinatesList(listOf(origin, destination))
            .alternatives(true)
            .build(),
        callback = object : NavigationRouterCallback {
            override fun onCanceled(routeOptions: RouteOptions, routerOrigin: RouterOrigin) {
                // no impl
            }

            override fun onFailure(reasons: List<RouterFailure>, routeOptions: RouteOptions) {
                // no impl
            }

            override fun onRoutesReady(
                routes: List<NavigationRoute>,
                routerOrigin: RouterOrigin
            ) {
                binding.navigationView.api.routeReplayEnabled(true)
                binding.navigationView.api.startActiveGuidance(routes)
            }
        }
    )
}}// Pa`

from react-native-mapbox-navigation.

mckeny3 avatar mckeny3 commented on June 4, 2024

thats my navigationView.kt...then this is the Navigationstarter to launch the activity `package com.mckenytech.swyfiodriver

import android.content.Intent
import android.widget.Toast
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod

internal class NavigationViewActivityStarter(reactContext: ReactApplicationContext?) :
ReactContextBaseJavaModule(reactContext) {
private var context: ReactApplicationContext = reactApplicationContext
override fun getName(): String {
return "RNMapboxNavigation"
}

@ReactMethod
fun navigateToExample() {
    Toast.makeText(context, "navigateToExample", Toast.LENGTH_LONG).show()
    val intent = Intent(context, NavigationViewActivity::class.java)
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
    context.startActivity(intent)

    context.currentActivity?.startActivity(intent)

}

} this is my navigationPackager.ktpackage com.mckenytech.swyfiodriver

import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager

class NavigationViewReactPackage : ReactPackage {
override fun createNativeModules(reactContext: ReactApplicationContext): List {
val modules: MutableList = ArrayList()
modules.add(NavigationViewActivityStarter(reactContext))
return modules
}

override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
    return emptyList()
}

} then register your packager in MainApplicationActivitypackage com.mckenytech.swyfiodriver;

import android.app.Application;
import android.content.res.Configuration;
import androidx.annotation.NonNull;

import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactNativeHost;
import com.facebook.soloader.SoLoader;

import expo.modules.ApplicationLifecycleDispatcher;
import expo.modules.ReactNativeHostWrapper;

import java.util.List;

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost =
new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {
@OverRide
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

  @Override
  protected List<ReactPackage> getPackages() {
    @SuppressWarnings("UnnecessaryLocalVariable")
    List<ReactPackage> packages = new PackageList(this).getPackages();

// @generated begin implementation installer - expo prebuild (DO NOT MODIFY) sync-cb41cfe4a065c99a5a8fd5b134dc14d6b4d71981
packages.add(new NavigationViewReactPackage());

// @generated end implementation installer
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}

  @Override
  protected String getJSMainModuleName() {
    return "index";
  }

  @Override
  protected boolean isNewArchEnabled() {
    return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
  }

  @Override
  protected Boolean isHermesEnabled() {
    return BuildConfig.IS_HERMES_ENABLED;
  }

});

@OverRide
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}

@OverRide
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
DefaultNewArchitectureEntryPoint.load();
}
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
ApplicationLifecycleDispatcher.onApplicationCreate(this);
}

@OverRide
public void onConfigurationChanged(@nonnull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
}
}
` now you will be able to launch it from the javascript side....this the latest mapbox ...10.13 and dropin ui 2.13 am using expo managed so i have to build config plugin to add all these...but if your useing bare workflow,you can add them directly

from react-native-mapbox-navigation.

Youssef-Durgham avatar Youssef-Durgham commented on June 4, 2024

thats my navigationView.kt...then this is the Navigationstarter to launch the activity `package com.mckenytech.swyfiodriver

import android.content.Intent import android.widget.Toast import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReactContextBaseJavaModule import com.facebook.react.bridge.ReactMethod

internal class NavigationViewActivityStarter(reactContext: ReactApplicationContext?) : ReactContextBaseJavaModule(reactContext) { private var context: ReactApplicationContext = reactApplicationContext override fun getName(): String { return "RNMapboxNavigation" }

@ReactMethod
fun navigateToExample() {
    Toast.makeText(context, "navigateToExample", Toast.LENGTH_LONG).show()
    val intent = Intent(context, NavigationViewActivity::class.java)
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
    context.startActivity(intent)

    context.currentActivity?.startActivity(intent)

}

} this is my navigationPackager.ktpackage com.mckenytech.swyfiodriver

import com.facebook.react.ReactPackage import com.facebook.react.bridge.NativeModule import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.uimanager.ViewManager

class NavigationViewReactPackage : ReactPackage { override fun createNativeModules(reactContext: ReactApplicationContext): List { val modules: MutableList = ArrayList() modules.add(NavigationViewActivityStarter(reactContext)) return modules }

override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
    return emptyList()
}

} then register your packager in MainApplicationActivitypackage com.mckenytech.swyfiodriver;

import android.app.Application; import android.content.res.Configuration; import androidx.annotation.NonNull;

import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; import com.facebook.react.defaults.DefaultReactNativeHost; import com.facebook.soloader.SoLoader;

import expo.modules.ApplicationLifecycleDispatcher; import expo.modules.ReactNativeHostWrapper;

import java.util.List;

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) { @OverRide public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; }

  @Override
  protected List<ReactPackage> getPackages() {
    @SuppressWarnings("UnnecessaryLocalVariable")
    List<ReactPackage> packages = new PackageList(this).getPackages();

// @generated begin implementation installer - expo prebuild (DO NOT MODIFY) sync-cb41cfe4a065c99a5a8fd5b134dc14d6b4d71981 packages.add(new NavigationViewReactPackage());

// @generated end implementation installer // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); return packages; }

  @Override
  protected String getJSMainModuleName() {
    return "index";
  }

  @Override
  protected boolean isNewArchEnabled() {
    return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
  }

  @Override
  protected Boolean isHermesEnabled() {
    return BuildConfig.IS_HERMES_ENABLED;
  }

});

@OverRide public ReactNativeHost getReactNativeHost() { return mReactNativeHost; }

@OverRide public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { // If you opted-in for the New Architecture, we load the native entry point for this app. DefaultNewArchitectureEntryPoint.load(); } ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); ApplicationLifecycleDispatcher.onApplicationCreate(this); }

@OverRide public void onConfigurationChanged(@nonnull Configuration newConfig) { super.onConfigurationChanged(newConfig); ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig); } } ` now you will be able to launch it from the javascript side....this the latest mapbox ...10.13 and dropin ui 2.13 am using expo managed so i have to build config plugin to add all these...but if your useing bare workflow,you can add them directly

can I get your telegram user and In your free time, answer my question because I will officially go crazy.

from react-native-mapbox-navigation.

riyansghrt avatar riyansghrt commented on June 4, 2024

any solution for this issue ?

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.