Error using Android next map map library.

Asked 2 years ago, Updated 2 years ago, 27 views

I'm using the following map API to create an app If you try to create and use a method to take a marker, the app keeps turning off.

This is the code.

public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, MapView.MapViewEventListener, MapView.POIItemEventListener {

    Public static final string API_KEY = "Next Map API"; //Actually use the following API key: I'll cover it here

    private BackPressCloseHandler backPressCloseHandler;
    private MapView mapView;
    MapPoint.GeoCoordinate CurrentLocation;
    MapPOIItem mDefaultMarker;


    public static final int FINE_PERMISSION = 1000;

    @Override
    protected void onCreate (Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mapView = new MapView(this);
        mapView.setDaumMapApiKey(API_KEY);
        ViewGroup mapViewContainer = (ViewGroup)findViewById(R.id.container);
        mapViewContainer.addView(mapView);

        int permissionFine = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION); // Location Permission Variable
        checkGPSPermission(permissionFine);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick (View view) {
               mapView.setCurrentLocationTrackingMode(MapView.CurrentLocationTrackingMode.TrackingModeOnWithoutHeading); //Get Current Location
            }
        });

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        drawer.setDrawerListener(toggle);
        toggle.syncState();

        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);

        backPressCloseHandler = newBackPressCloseHandler (this); //Handler to exit by pressing the Back key twice
        CreateDefaultMarker (mapView); // Error when calling this part


    }

    private void createDefaultMarker(MapView mapView) {
        mDefaultMarker = new MapPOIItem();
        mDefaultMarker.setItemName("Marker");
        mDefaultMarker.setTag(0);
        mDefaultMarker.setMapPoint(MapPoint.mapPointWithGeoCoord(126.8439946101, 37.3282802259));
        mDefaultMarker.setMarkerType(MapPOIItem.MarkerType.BluePin);
        mDefaultMarker.setSelectedMarkerType(MapPOIItem.MarkerType.RedPin);

        mapView.addPOIItem(mDefaultMarker);
        mapView.selectPOIItem(mDefaultMarker, true);
        mapView.setMapCenterPoint(MapPoint.mapPointWithGeoCoord(126.8439946101, 37.3282802259), true);
    }
    //Omit the rest (bottom part)

The error code is 05-07 23:46:27.785 937-1364/kingofparking.vmffn.com.kingofparking A/libc: Fatal signal 11 (SIGSEGV), code 1, faultaddr 0x0 intid 1364 (GLThread 48521)

It pops up like this, but when I googled it, it says it's because I referred to the wrong address, but I don't know why. I brought the createDefaultMarker method of creating a marker among the codes in the following map sample SDK, but there is an error. Adding android:hardwareAccelerated="false" to P.S Manifest does not solve it

android

2022-09-22 21:09

1 Answers

May I know the following map sample SDK link you are referring to? The error you uploaded is the log that was output when an error occurred in the JNI code of the following map library. Therefore, it is difficult to find problems with Java code. The guess is that the part that needs to be initialized is not initialized or the order of calling the API is wrong.

If you tell me the following map sample SDK for reference, I think I can compare it with the code you posted. It is also necessary to check if the sample code you are referring to actually works well. Make sure your library is up to date. For your information, there was no particular problem when printing the next map API.


2022-09-22 21:09

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.