Partage
  • Partager sur Facebook
  • Partager sur Twitter

[java] Problème KML librairi

    17 août 2017 à 14:53:54

    Bonjour, Je viens poster ici parce qu'après des jours de recherche je n'ai pas pu résoudre mon problème.

    Je travaille sur une application nommé sépale développé sous android studio.

    Alors voila j'explique ce qui m'arrive, En revenant de vacances, j'ai fait une mise à jour sur android studio, suite a cela la librairie que j'utilisait pour le kml a changer. dans mon activity j'avait 

    import com.google.maps.android.kml.KmlLayer;

    Celui-ci étais donc incorrect après mon retour. 

    le nouveau étant :

    import com.google.maps.android.data.kml.KmlLayer;

    Le problème est que depuis que j'ai changer celà, celà ne fonctionne plus du tout. en visitant les forum,J'ai découvert qu'il fallait changé les dépendance dans le build.graddle. Cependant lors si je fait celà un paquet de chose autre que le kml ce mettent a ne plus marcher. 
    Je vous mets l'activity ou est utilisé le kml et le build.gradle.

    Activity :

    package fr.circet.foa.activities;
    
    import android.Manifest;
    import android.content.Context;
    import android.content.Intent;
    import android.location.Location;
    import android.location.LocationManager;
    import android.os.Bundle;
    import android.support.annotation.NonNull;
    import android.support.annotation.Nullable;
    import android.support.v4.app.FragmentTransaction;
    import android.support.v4.content.ContextCompat;
    import android.support.v4.util.ArrayMap;
    import android.support.v4.util.Pair;
    import android.util.DisplayMetrics;
    import android.util.Log;
    import android.widget.Toast;
    
    import com.google.android.gms.maps.CameraUpdateFactory;
    import com.google.android.gms.maps.GoogleMap;
    import com.google.android.gms.maps.OnMapReadyCallback;
    import com.google.android.gms.maps.SupportMapFragment;
    import com.google.android.gms.maps.model.BitmapDescriptorFactory;
    import com.google.android.gms.maps.model.CameraPosition;
    import com.google.android.gms.maps.model.LatLng;
    import com.google.android.gms.maps.model.LatLngBounds;
    import com.google.android.gms.maps.model.Marker;
    import com.google.android.gms.maps.model.MarkerOptions;
    import com.google.android.gms.maps.model.Polyline;
    import com.google.android.gms.maps.model.PolylineOptions;
    import com.google.maps.android.data.kml.KmlLayer;
    import com.google.android.gms.maps.model.Polygon;
    import org.xmlpull.v1.XmlPullParserException;
    
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    
    import butterknife.OnClick;
    import fr.circet.foa.R;
    import fr.circet.foa.models.AbstractPoi;
    import fr.circet.foa.models.BalPoi;
    import fr.circet.foa.models.Link;
    import fr.circet.foa.models.PoiMarker;
    import fr.circet.foa.models.PotPoi;
    import fr.circet.foa.tools.CheckPermissionTask;
    import fr.circet.foa.tools.LocationUtils;
    
    /**
     * Abstract project map : handles the following features :
     * - requests location permissions
     * - loads a map in a framelayout with id "map"
     * - loads kml layer and map types (i.e satellite mode etc ... )
     * - loads poi marker on a map
     * - center map on pois or user position
     * - loads cables ( ie : polyline)
     * <p/>
     * You must override getProjectPoi and apply map padding
     * You can override hideMarkerInfo and showMarkerInfo
     */
    public abstract class AbstractProjectMapActivity extends BaseActivity implements GoogleMap.OnCameraChangeListener {
    
    
        /**
         * Log tag.
         */
        protected static final String LOG_TAG = AbstractProjectMapActivity.class.getName();
    
        /**
         * Permission request code: user location.
         */
        protected static final int CHECK_LOCATION_PERMISSIONS_REQUEST_CODE = 201;
    
        /**
         * Map configuration update request code.
         */
        protected static final int REQUEST_CODE_UPDATE_CONFIGURATION = 16131;
    
        /**
         * List of PoiMarkers displayed on the map.
         */
        protected final List<PoiMarker> mPoiMarkers = new ArrayList<>();
    
        protected ArrayMap<String, KmlLayer> mKmlMap;
    
        /**
         * Map fragment.
         */
        protected SupportMapFragment mMapFragment;
    
        /**
         * Page map.
         */
        protected GoogleMap mGoogleMap;
    
    
        /**
         * Map Zoom default value
         */
        protected float mSZoomDefault = 5;
    
    
        /**
         * Location permission checker.
         */
        protected CheckPermissionTask mCheckPermissionTask;
    
        /**
         * List of polylines in the map
         */
        private List<Polyline> mPolylineList = new ArrayList<>();
    
        /**
         * Current direction of the north : useful for drawing the direction of the hauban on the map
         */
        protected float mCurrentBearingDirection;
    
        /**
         * Interface to use when the direction of the north has changed
         */
        protected interface BearingListener {
            void onBearingChanged(float diff);
        }
    
        private BearingListener mBearingListener;
    
        @Override
        protected abstract int getLayoutResourceId();
    
        @Override
        protected boolean onActivityCreated(final Bundle savedInstanceState) {
            if (!super.onActivityCreated(savedInstanceState)) {
                return false;
            }
    
    
            if (mCurrentProject == null) {
                Log.w(LOG_TAG, "Missing current project reference");
                finish();
    
                return false;
            } else {
                FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
                mMapFragment = new SupportMapFragment();
                trans.replace(R.id.map, mMapFragment);
                trans.commitAllowingStateLoss();
    
                mMapFragment.getMapAsync(new OnMapReadyCallback() {
                    @Override
                    public void onMapReady(GoogleMap googleMap) {
                        initializeMap();
                    }
                });
            }
    
            // Ask for permissions
            mCheckPermissionTask = new CheckPermissionTask(this,
                    CHECK_LOCATION_PERMISSIONS_REQUEST_CODE,
                    Manifest.permission.ACCESS_COARSE_LOCATION,
                    Manifest.permission.ACCESS_FINE_LOCATION);
            mCheckPermissionTask.executeWithCheck();
    
            return true;
        }
    
        @Override
        protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
            if ((requestCode == REQUEST_CODE_UPDATE_CONFIGURATION) && (resultCode == RESULT_OK)) {
                setMapModeFromProject();
    
                setKmlsFromProject();
            }
        }
    
        @Override
        protected void onResume() {
            super.onResume();
    
            if (mGoogleMap != null) {
                initKmls();
            }
    
            mGoogleApiClient.connect();
    
            if (isPolylineDisplayed()) {
                addOrUpdatePolylines();
            }
    
        }
    
        @Override
        protected void onPause() {
            mGoogleApiClient.disconnect();
            super.onPause();
        }
    
    
        /**
         * Called when the edit map button is clicked.
         * Opens the map edition fragment.
         */
        @Nullable @OnClick(R.id.map_layers_button)
        protected void onEditMapButtonClicked() {
            Intent intent = new Intent(this, MapConfigurationActivity.class);
            startActivityForResult(intent, REQUEST_CODE_UPDATE_CONFIGURATION);
        }
    
        /**
         * Map Initialization.
         */
        protected void initializeMap() {
            if (mGoogleMap == null) {
                try {
                    mGoogleMap = mMapFragment.getMap();
    
                    if (applyMapPadding()) {
                        int mapPadding = getResources().getDimensionPixelSize(R.dimen.map_search_bar_height);
                        Log.i(LOG_TAG, "Apply map padding: " + mapPadding);
                        mGoogleMap.setPadding(0, mapPadding, 0, 0);
                    }
    
                    mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(
                            new LatLng(LocationUtils.LATITUDE_DEFAULT, LocationUtils.LONGITUDE_DEFAULT), getZoomDefault()));
                    mGoogleMap.setMyLocationEnabled(true);
                    mGoogleMap.getUiSettings().setMyLocationButtonEnabled(true);
                    mGoogleMap.getUiSettings().setCompassEnabled(enableMapRotation());
                    mGoogleMap.getUiSettings().setRotateGesturesEnabled(enableMapRotation());
                    mGoogleMap.setOnCameraChangeListener(this);
                    // Set the map mode, using the information stored in the current project.
                    setMapModeFromProject();
    
    
    
    
                    // Set and load the KML layers, using the information stored in the current project.
                    initKmls();
    
                    // Display Markers on Map
                    drawMapElements();
    
                    // Init marker list for search
                    mCurrentProject.createAutoCompleteList();
    
                    // Init marker clicks listener
                    initGMapClickListeners();
    
    
                    // Center on the user location, when the project has no POIs
                    if (mPoiMarkers.isEmpty()) {
                        initGMapLocationListeners();
                    } else {
                        centerOnPois();
                    }
    
                } catch (Exception e) {
                    Log.w(LOG_TAG, "Error during Map initialization", e);
                }
            }
        }
    
        protected boolean enableMapRotation() {
            return true;
        }
    
        protected boolean isPolylineDisplayed() {
            return true;
        }
    
        /**
         * This method is used to display the cables on the map AND to update the icon of the Pot Poi
         */
        protected final void addOrUpdatePolylines() {
    
    
            if (mCurrentProject.getLinkSet() != null) {
                    for (Polyline polyline : mPolylineList) {
                    polyline.remove();
                }
    
                mCurrentProject.setListLinkIsDisplayed(false);
    
                for (Link link : mCurrentProject.getLinkSet()) {
    
                    if (!link.isDisplayed())
                    {
                        PolylineOptions polylineOptions = new PolylineOptions();
    
    
                        if(mCurrentProject.isMapInPolyligneColor()) {
                            int color = mCurrentProject.defineColorPolyline(mCurrentProject.getLinkSet(), link);
                            polylineOptions.color(ContextCompat.getColor(this, color));
    
                        }else{
    
                            int greenColor = R.color.cable_color_tel;
                            polylineOptions.color(ContextCompat.getColor(this, greenColor));
                        }
    
                        polylineOptions.width(5.00F);
    
                            Pair<String, String> linkPoi = link.getPairAbstractPoi();
    
                            PoiMarker sourceMarker = getMarkerWithId(linkPoi.first);
                            PoiMarker destinationMarker = getMarkerWithId(linkPoi.second);
    
    
                            // draw the line and change the icon
                            if (sourceMarker != null && destinationMarker != null) {
                                polylineOptions.add(sourceMarker.getCoordinates());
                                polylineOptions.add(destinationMarker.getCoordinates());
                            }
    
    
                            if (mGoogleMap != null) {
    
                                mPolylineList.add(mGoogleMap.addPolyline(polylineOptions));
                            }
                        }
                    }
    
    
                }
    
            for(BalPoi poi : mCurrentProject.getPoiListWithBalType()) {
                if(poi.getDestinationId() != null) {
    
                    PoiMarker sourceMarker = getMarkerWithId(poi.getInternalId());
                    PoiMarker destinationMarker = getMarkerWithId(poi.getDestinationId());
    
                    PolylineOptions polylineOptions = new PolylineOptions();
    
    
                    polylineOptions.width(5.00F);
                    polylineOptions.color(ContextCompat.getColor(this, R.color.bal_primary_color));
    
                    if (sourceMarker != null && destinationMarker != null) {
                        polylineOptions.add(sourceMarker.getCoordinates());
                        polylineOptions.add(destinationMarker.getCoordinates());
                    }
    
                    if (mGoogleMap != null) {
    
                        mPolylineList.add(mGoogleMap.addPolyline(polylineOptions));
                    }
                }
    
            }
    
    
        }
    
        /**
         * KML project files initialization.
         */
        protected void initKmls() {
            setKmlsFromProject();
            loadKmlLayers();
        }
    
        /**
         * Retrieve KML file list.
         * Create KML layers from KML file resources.
         */
        private void setKmlsFromProject() {
            if (mKmlMap == null) {
                mKmlMap = new ArrayMap<>();
            }
    
            List<String> kmlNames = mCurrentProject.getKmlNames();
    
            for (String kmlName : kmlNames) {
                if (!mKmlMap.containsKey(kmlName)) {
                    String kmlPath = mProjectManager.getKmlPath(mCurrentProject, kmlName);
    
                    if (kmlPath != null) {
                        KmlLayer kmlLayer = mKmlMap.get(kmlName);
                        if (kmlLayer == null) {
                            kmlLayer = createKmlLayer(kmlPath);
                        }
    
                        if (kmlLayer != null) {
                            mKmlMap.put(kmlName, kmlLayer);
                        }
                    }
                }
            }
        }
    
        /**
         * Create a KML Layer from provided file path.
         *
         * @param filePath kml file path to create layer from.
         */
        private KmlLayer createKmlLayer(String filePath) {
            KmlLayer layer = null;
    
            try {
                File file = new File(filePath);
                if (file.exists()) {
                    FileInputStream fileInputStream = new FileInputStream(file);
                    layer = new KmlLayer(mGoogleMap, fileInputStream, getApplicationContext());
                }
            } catch (XmlPullParserException e) {
                Log.w(LOG_TAG, "Error during Kml layer creation - xml parsing", e);
            } catch (IOException e) {
                Log.w(LOG_TAG, "Error during Map initialization", e);
            }
    
            return layer;
        }
    
        /**
         * Load KMLs on map, according to their visibility.
         */
        private void loadKmlLayers() {
    
            for (int i = 0; i < mKmlMap.size(); i++) {
                try {
                    KmlLayer eaze = mKmlMap.valueAt(i);
                    if (mCurrentProject.getKmlVisibility(mKmlMap.keyAt(i))) {
                        eaze.addLayerToMap();
                    }
                } catch (IOException e) {
                    Log.w(LOG_TAG, "Error during Kml layer creation", e);
                } catch (XmlPullParserException e) {
                    Log.w(LOG_TAG, "Error during Kml layer creation - xml parsing", e);
                }
            }
        }
    
        /**
         * Update the map mode according to the current project settings.
         */
        private void setMapModeFromProject() {
            int currentMapType = mGoogleMap.getMapType();
            int newMapType;
            if (mCurrentProject.isMapInHybridMode()){
                newMapType = GoogleMap.MAP_TYPE_HYBRID;
            }
            else if (mCurrentProject.isMapInSatelliteMode()) {
                newMapType = GoogleMap.MAP_TYPE_SATELLITE ;
            }
            else {
                newMapType = GoogleMap.MAP_TYPE_NORMAL;
            }
    
            if (currentMapType != newMapType) {
                mGoogleMap.setMapType(newMapType);
            }
        }
    
        /**
         * Map location listeners initialization.
         */
        private void initGMapLocationListeners() {
            mGoogleMap.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {
                private boolean alreadyDone = false;
    
                @Override
                public void onMyLocationChange(Location location) {
                    if (!alreadyDone) {
                        alreadyDone = true;
                        centerOnLocation(location, false);
                    }
                }
            });
            checkMyLocation(false);
        }
    
        /**
         * Map click listeners initialization.
         */
        protected void initGMapClickListeners() {
            mGoogleMap.setOnMyLocationButtonClickListener(new GoogleMap.OnMyLocationButtonClickListener() {
                @Override
                public boolean onMyLocationButtonClick() {
                    checkMyLocation(true);
                    return false;
                }
            });
        }
    
        /**
         * Checks if location is accessible from gps or network.
         *
         * @param checkPermissionToo indicate that the permission should be checked too.
         */
        private void checkMyLocation(final boolean checkPermissionToo) {
            LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
            boolean gpsEnabled = false;
            boolean networkEnabled = false;
            boolean hasPermissions = true;
    
            try {
                gpsEnabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
            } catch (Exception e) {
                Log.w(LOG_TAG, "GPS location provider not available", e);
            }
    
            try {
                networkEnabled = lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
            } catch (Exception e) {
                Log.w(LOG_TAG, "Network location provider not available", e);
            }
    
            if (checkPermissionToo && (mCheckPermissionTask != null)) {
                hasPermissions = mCheckPermissionTask.hasPermissions();
            }
    
            if ((!gpsEnabled && !networkEnabled) || !hasPermissions) {
                Toast.makeText(this, getString(R.string.map_error_localisation), Toast.LENGTH_LONG).show();
            }
        }
    
        /**
         * Move the camera and zoom to the given location.
         *
         * @param location location to focus on the map
         * @param animated move and zoom with an animation (true) or instantly (false)
         */
        private void centerOnLocation(Location location, boolean animated) {
            centerOnLocation(new LatLng(location.getLatitude(), location.getLongitude()), animated);
        }
    
        /**
         * Move the camera and zoom to the given coordinates.
         *
         * @param latLng   coordinates to focus on the map
         * @param animated move and zoom with an animation (true) or instantly (false)
         */
        protected void centerOnLocation(LatLng latLng, boolean animated) {
            float zoom = Math.max(mGoogleMap.getCameraPosition().zoom, LocationUtils.ZOOM_CENTER_DEFAULT);
    
            if (animated) {
                mGoogleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom));
            } else {
                mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoom));
            }
        }
    
        /**
         * Center the map on the project POIs.
         */
        protected void centerOnPois() {
            LatLngBounds.Builder boundsBuilder = LatLngBounds.builder();
    
            for (PoiMarker poiMarker : mPoiMarkers) {
                LatLng coordinates = poiMarker.getCoordinates();
    
                if (coordinates != null) {
                    boundsBuilder.include(coordinates);
                }
            }
    
            int verticalPadding = getResources().getDimensionPixelSize(R.dimen.map_search_bar_height) * 2;
            int padding = getResources().getDimensionPixelSize(R.dimen.map_zoom_margin);
            DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
            mGoogleMap.animateCamera(
                    CameraUpdateFactory.newLatLngBounds(boundsBuilder.build(),
                            displayMetrics.widthPixels, displayMetrics.heightPixels - verticalPadding,
                            padding));
    
            if (mPoiMarkers.size() == 1) {
                PoiMarker mPoiMarker = mPoiMarkers.get(0);
                LatLng latLng = mPoiMarker.getPoi().getCoordinates();
                mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, getZoomDefault()));
            }
        }
    
        /**
         * Markers initialization.
         */
        protected void drawMapElements() {
            setProjectMarkers();
            addMarkers();
    
            // add lines
            if (isPolylineDisplayed()) {
                addOrUpdatePolylines();
            }
        }
    
        /**
         * Create CustomMarkers from project POIs.
         * clear the map of all its content
         */
        protected void setProjectMarkers() {
            if (mGoogleMap != null) {
                mGoogleMap.clear();
            }
        }
    
        /**
         * Add makers on map from CustomMarkers.
         */
        private void addMarkers() {
            if (mGoogleMap != null) {
                for (PoiMarker poiMarker : mPoiMarkers) {
    
                    LatLng markerCoordinates = poiMarker.getCoordinates();
                    if (markerCoordinates != null) {
                        Marker marker = mGoogleMap.addMarker(new MarkerOptions()
                                .position(markerCoordinates)
                                .icon(BitmapDescriptorFactory.fromResource(poiMarker.getIconResourceId())));
                        poiMarker.setMarker(marker);
    
    
                        // set the arrow for a pot poi
                        if (isPotDirectionVisible(poiMarker)) {
                            setArrowHauban(poiMarker, ((PotPoi) poiMarker.getPoi()).getHaubanAngle());
                        }
                    }
                }
            }
        }
    
        /**
         * Get the marker whose abstract Poi has the id given in parameter or null if not found
         *
         * @param internalId the internalId of the AbstractPoi associated with the Poi Marker
         * @return the PoiMarker
         */
        private PoiMarker getMarkerWithId(@NonNull String internalId) {
            for (PoiMarker poiMarker : mPoiMarkers) {
                if (internalId.equals(poiMarker.getPoi().getInternalId())) {
                    return poiMarker;
                }
            }
            return null;
        }
    
        protected boolean isPotDirectionVisible(final PoiMarker poiMarker) {
            AbstractPoi poi = poiMarker.getPoi();
            return poi instanceof PotPoi && ((PotPoi) poi).hasHaubanAngle() && ((PotPoi) poi).isDirectionHaubanVisible();
        }
    
        /**
         * add arrow indicating the direction of the hauban for a pot poi
         *
         * @param poiMarker the poi marker that holds the reference of a pot poi
         * @param angle     the new angle for the direction of the hauban ( horizontal axis as reference )
         */
        protected void setArrowHauban(final PoiMarker poiMarker, final double angle) {
            Marker previousDirectionMarker = poiMarker.getDirectionHaubanMarker();
            if (previousDirectionMarker != null) {
                previousDirectionMarker.remove();
            }
            Marker directionHaubanMarker = mGoogleMap.addMarker(new MarkerOptions()
                    .position(poiMarker.getCoordinates())
                    .icon(BitmapDescriptorFactory.fromResource(R.drawable.arrow_map))
                    .anchor(0, 0.5f)
                    .rotation((float) angle));
            poiMarker.setDirectionHaubanMarker(directionHaubanMarker);
    
        }
    
    
        protected void setBearingChangedListener(BearingListener bearingListener) {
            mBearingListener = bearingListener;
        }
    
        /**
         * Hide marker info window.
         */
        protected void hideMarkerInfo() {
    
        }
    
        /**
         * Show marker information
         *
         * @param marker the marker for which we want to display information
         */
        protected void showMarkerInfo(final Marker marker) {
    
        }
    
        protected boolean applyMapPadding() {
            return true;
        }
    
        protected float getZoomDefault() {
            return mSZoomDefault;
        }
    
        @Override public void onCameraChange(final CameraPosition cameraPosition) {
            Log.w("onCameraChanged", "" + cameraPosition.bearing);
    
            if (mCurrentBearingDirection != cameraPosition.bearing) {
                mCurrentBearingDirection = cameraPosition.bearing;
                if (mBearingListener != null) {
                    mBearingListener.onBearingChanged(mCurrentBearingDirection);
                }
            }
            mCurrentProject.setmLastZoom(cameraPosition.zoom);
    
        }
    }
    



    build.graddle :

    apply plugin: 'com.android.application'
    apply plugin: 'com.neenbedankt.android-apt'
    apply plugin: 'com.jakewharton.hugo'
    
    apply plugin: 'io.fabric'
    
    android {
        compileSdkVersion 23
        buildToolsVersion '25.0.0'
        defaultConfig {
            applicationId 'fr.circet.foa'
            minSdkVersion 16
            targetSdkVersion 23
            versionCode 39
            versionName '0.2.39'
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    
        productFlavors {
            prod {
            }
            dev {
            }
        }
    
        signingConfigs {
            debug {
                storeFile file('../debug.keystore')
            }
        }
    }
    
    dependencies {
        // Support libraries
        compile 'com.android.support:appcompat-v7:23.0.1'
        compile 'com.android.support:recyclerview-v7:23.0.1'
        compile 'com.android.support:design:23.0.1'
        compile 'com.android.support:cardview-v7:23.0.1'
        // Injections
        compile 'com.google.dagger:dagger:2.0.1'
        apt 'com.google.dagger:dagger-compiler:2.0.1'
        provided 'javax.annotation:jsr250-api:1.0'
        compile 'com.jakewharton:butterknife:7.0.1'
        // File picker
        compile 'com.nononsenseapps:filepicker:2.4.1'
        // Data parsing
        compile 'com.google.code.gson:gson:2.3.1'
        // Maps
        compile 'com.google.android.gms:play-services-base:8.1.0'
        compile 'com.google.android.gms:play-services-maps:8.1.0'
        compile 'com.google.android.gms:play-services-location:8.1.0'
        compile 'com.google.maps.android:android-maps-utils:0.4+'
        // Image management
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile 'com.commit451:PhotoView:1.2.4'
        // thread operations
        compile 'com.parse.bolts:bolts-android:1.4.0'
        //zip operations
        compile 'net.lingala.zip4j:zip4j:1.3.2'
        // Crashlytics
        compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
            transitive = true;
        }
        compile 'com.github.bmelnychuk:atv:1.2.+'
    }
    

    Ici je n'ai rien changé dans le build.gradle

    y'a t'il un moyen de garder le fonctionnement qu'avait le kml avant car il serait impossible de changer tous le reste car j'ai des délais a respecter pour des autres évolutions. 

    Si je compile et que je lance l'applicaiton comme tel, lors du moment de faire le mKmlMap.valueAt(i).addLayerToMap , J'obtiens une erreur du type.
    java.lang.NoSuchMethodError: com.google.android.gms.maps.model.Polygon.setClickable

    En méttant les dépendances à jours elle disparait, mais les autres problèmes arrivent.

    Une moyen de régler ça simplement, Je suis coincé sur ça depuis lundi. J'ai tout essayer. mettre à jour le graddle. changez les dépendances mais rien n'y fait. 

    -
    Edité par TomSeon 17 août 2017 à 15:03:26

    • Partager sur Facebook
    • Partager sur Twitter

    [java] Problème KML librairi

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown