Code Monkey home page Code Monkey logo

Comments (29)

kingydw avatar kingydw commented on May 7, 2024 3

Got the same error on react-native 0.35 and react-native-maps 0.11.0. Reinstall in manually way didn't help. Then I clicked xcode->product->clean and shutdown all terminals and simulator. react-native run-ios again. It worked!

from react-native-maps.

nillo avatar nillo commented on May 7, 2024

I got this error with another package, it means, that the linking went wrong, ur apps wants to call its native counterparts but they cannot be found, i didnt work on android yet, but go to xcode and then to libraries, u should se, Airmaps.xcodeproj <-- containing 2 folders 'Airmaps' and 'Products', this should contain, your native components. if u don't have this, try running rpmn link again, or try the manual installation. Also if u click on your application within xcode (top level in project folder structure ('appname') and then go to build phases, u will see an item called ' link binary with libraries' , there it should contain 'libAirMaps.a'

if all this is available, to to click on the to top menubar click on product, and select clean, then build, then run.

and see if it works.

from react-native-maps.

kulikalov avatar kulikalov commented on May 7, 2024

i've just rolled all changes back, then install react-native-maps and linked everything manually in xcode.
Now, build is failing with this errors:

/node_modules/react-native-maps/ios/AirMaps/AIRMapManager.m:99:39: Incompatible block pointer types sending 'void (^)(RCTUIManager *__strong, NSDictionary<NSNumber *,UIView *> *__strong)' to parameter of type 'RCTViewManagerUIBlock' (aka 'void (^)(RCTUIManager *__strong, RCTSparseArray *__strong)')

error repeating 3 times during the build process, then build is failing

from react-native-maps.

lelandrichardson avatar lelandrichardson commented on May 7, 2024

@mdcsfk The latest error you are getting sounds like a real compatibility problem with this library and RN 0.15

I'm not sure what else would be involved with getting this lib compatible with older versions of RN, but I will try and check it out.

Officially, this library was only really intended to be compatible with 0.17+, but if it is easier to have broader compatibility, I will attempt to do so.

from react-native-maps.

kulikalov avatar kulikalov commented on May 7, 2024

thank you! May be i will use the older version for now?

from react-native-maps.

guofoo avatar guofoo commented on May 7, 2024

I've tried using the library with react-native 0.17 and 0.18 but am getting blank screen in both cases. I've also tried both the rnpm link and manual installations, but it doesn't seem to make a difference.

I don't see any errors, and I'm rendering only the most basic test code:

      <MapView
        initialRegion={{
          latitude: 37.78825,
          longitude: -122.4324,
          latitudeDelta: 0.0922,
          longitudeDelta: 0.0421,
        }}
      />

I tried removing the latitudeDelta line, and I do get an error saying it is needed so it seems to silently fail elsewhere.

from react-native-maps.

lelandrichardson avatar lelandrichardson commented on May 7, 2024

@guofoo android or ios? If android, have you set your API key, and installed google play services on the device?

from react-native-maps.

guofoo avatar guofoo commented on May 7, 2024

It was IOS. But after hours of trying, as soon as I typed the comment, I had an epiphany and added a style element with flex: 1 and, viola, the map showed up. My bad.

from react-native-maps.

lelandrichardson avatar lelandrichardson commented on May 7, 2024

ah! no worries :)

from react-native-maps.

lopezjurip avatar lopezjurip commented on May 7, 2024

Same problem here.

  • React Native 0.18.1
  • Installed with npm install react-native-maps --save
  • rnpm link
import React, { StyleSheet, Text, View, Component } from 'react-native'

import MapView from 'react-native-maps'

export default class MapsView extends Component {
  render() {
    return (
      <View style={styles.container}>
        <MapView
          initialRegion={{
            latitude: 37.78825,
            longitude: -122.4324,
            latitudeDelta: 0.0922,
            longitudeDelta: 0.0421,
          }}
        ></MapView>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
})

And I see a blank screen on iOS emulator and Android device 😞

from react-native-maps.

lelandrichardson avatar lelandrichardson commented on May 7, 2024

@mrpatiwi can you try the styles that the example uses?

  container: {
    position: 'absolute',
    top: 0,
    left: 0,
    right: 0,
    bottom: 0,
    justifyContent: 'flex-end',
    alignItems: 'center',
  },
  map: {
    position: 'absolute',
    top: 0,
    left: 0,
    right: 0,
    bottom: 0,
  },

from react-native-maps.

lelandrichardson avatar lelandrichardson commented on May 7, 2024

also, if we need to change the default styles on the mapview to be flex: 1, i'm happy to do that...

from react-native-maps.

lopezjurip avatar lopezjurip commented on May 7, 2024

It's working on iOS after unlinking, uninstalling, installing again, linking again and using:

const styles = StyleSheet.create({
  container: {
    position: 'absolute',
    top: 0,
    left: 0,
    right: 0,
    bottom: 0,
    justifyContent: 'flex-end',
    alignItems: 'center',
  },
  map: {
    position: 'absolute',
    top: 0,
    left: 0,
    right: 0,
    bottom: 0,
  },
})

/* Also works with:
const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  map: {
    flex: 1,
  },
})
*/

But trying to run on Android throws:

$ react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Cannot evaluate module react-native-maps : Configuration with name 'default' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.755 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

from react-native-maps.

ischenkodv avatar ischenkodv commented on May 7, 2024

Cannot evaluate module react-native-maps : Configuration with name 'default' not found.

Same problem for me on Android when running react-native run-android. The version of react-native is 0.18-rc. I used the following installation procedure:

npm install react-native-maps --save
rnpm link

How this could be solved?

from react-native-maps.

lelandrichardson avatar lelandrichardson commented on May 7, 2024

Hmm. I think rnpm is maybe not working for this module anymore.

Can you check to make sure your settings.gradle and build.gradle file look like they say they should here: https://github.com/lelandrichardson/react-native-maps/blob/master/docs/installation.md

from react-native-maps.

graywolf336 avatar graywolf336 commented on May 7, 2024

I am having the same issue, when using the rnpm link method. My settings.gradle ended up looking like this:

rootProject.name = 'Zara'

include ':app'
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps//Users/bradley/Documents/workspace/zara-native/node_modules/react-native-maps/android')

I changed it to the following and I got past the error @mrpatiwi and @ischenkodv are having:

rootProject.name = 'Zara'

include ':app'
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/android')

And then in my MainActivity.java it was importing import com.mapbox.AirMaps.AirPackage; instead of import com.AirMaps.AirPackage;

Once those items were changed, it built fine for Android. I have yet to test out iOS and will report back.

from react-native-maps.

lelandrichardson avatar lelandrichardson commented on May 7, 2024

@graywolf336 thanks for this helpful information. I will try and get rnpm working correctly. Not sure what it's looking at right not to get these bad values.

from react-native-maps.

graywolf336 avatar graywolf336 commented on May 7, 2024

@lelandrichardson Welcome, thanks for making this package.

After looking into the code, it seems your AndroidManifest.xml file has the package defined as com.mapbox.AirMaps, here, but in all of the Java source files the packages are using com.AirMaps. So, that would fix the reference errors in the MainActivity.java files.

from react-native-maps.

lelandrichardson avatar lelandrichardson commented on May 7, 2024

@graywolf336 thanks for pointing that out! i've updated it and it is now available in 0.1.3 on npm

from react-native-maps.

lopezjurip avatar lopezjurip commented on May 7, 2024

project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/android')

That fixed my problem 👍

from react-native-maps.

ischenkodv avatar ischenkodv commented on May 7, 2024

I managed to install it using manual installation instructions for Android. The only thing that is different from instructions is step 3:

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new AirPackage()
        );
    }

I had to do it this way because there was no onCreate method in the MainActivity.java file. The version of React Native is 0.18-rc.

from react-native-maps.

lelandrichardson avatar lelandrichardson commented on May 7, 2024

@ischenkodv can you copy/paste in here your entire MainActivity.java file?

from react-native-maps.

ischenkodv avatar ischenkodv commented on May 7, 2024

@lelandrichardson

package com.mobile;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;

import com.AirMaps.AirPackage; // <--- This!

import java.util.Arrays;
import java.util.List;

public class MainActivity extends ReactActivity {

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "mobile";
    }

    /**
     * Returns whether dev mode should be enabled.
     * This enables e.g. the dev menu.
     */
    @Override
    protected boolean getUseDeveloperSupport() {
        return BuildConfig.DEBUG;
    }

   /**
   * A list of packages used by the app. If the app uses additional views
   * or modules besides the default ones, add more packages here.
   */
    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new AirPackage()
        );
    }

}

from react-native-maps.

christopherdro avatar christopherdro commented on May 7, 2024

@ischenkodv
There was change in 0.18 that added a base activity named ReactActivity.

@lelandrichardson We can just update the docs to reflect that.

from react-native-maps.

programmersharp avatar programmersharp commented on May 7, 2024

I have the same problem with 'react-native-maps' - blank screen in Android emulator. Seems I followed all the instructions in the topic.

from react-native-maps.

christopherdro avatar christopherdro commented on May 7, 2024

@programmersharp Did you make sure to install google play services and provide a API key?

I also don't think we should be spending to much time supporting older versions of React Native. @lelandrichardson Thoughts?

from react-native-maps.

programmersharp avatar programmersharp commented on May 7, 2024

@christopherdro thank for you help. I discovered what happens. So, it works on Android device, though it doesn't work on Android emulator for Visual Studio (I still see blank screen). Actually it's not a big problem anymore. Now I have another problem with image with absolute path on marker with custom view (it's not shown in some cases). I found one coincidence - images that are declared somewhere else on the view are shown in marker with custom view correctly too. So, let me explain what I mean, Imagine somewhere in application (outside of the map) I have image with uri equals URL1 and it's shown correctly there. If I have image with the same uri equals URL1 in marker with custom view it's shown correctly in the map. But if I don't have image with uri equals URL2 outside of the map, in this case image is not shown in marker with custom view at all.

from react-native-maps.

dg92 avatar dg92 commented on May 7, 2024

i have same problem running react-native-maps on android avd 'blank screen', tried everything mentioned in comments but no success.

"react-native": "^0.22.2",
play services installed,
api key provided,
manual installation of react-native-maps

Please help to resolve.

from react-native-maps.

christopherdro avatar christopherdro commented on May 7, 2024

Closing this for now since it's looks like our minimum version will be 0.20.
Based on the recent changes requiring react to be a dependency of your project rather than a peer dependency of react native.

from react-native-maps.

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.