无法将Gradle项目导入Eclipse Photon

时间:2018-08-07 03:25:54

标签: java eclipse gradle eclipse-photon

我有一个项目,该项目过去可以很好地加载到Eclipse Oxygen中。最近,我将Eclipse升级到Photon。从那时起,当我尝试导入项目时开始出现以下错误。有关如何解决此问题的任何想法?我正在使用Gradle 4.9(包装器)和Eclipse Photon(最新版)。

当我导入其他项目时,我似乎没有任何问题。我不确定哪个特定的项目设置会导致此问题。

<!DOCTYPE html>
<!-- http://gmaps-samples-v3.googlecode.com/svn/trunk/drawing/drawing-tools.html -->
<!-- https://developers.google.com/maps/documentation/javascript/examples/places-searchbox 
https://gist.github.com/mhewedy/836d88158b8cdc24494fb5f8b402dd53 -->
<html>

  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="UTF-8">
    <title>Draw test</title>
    <!-- NOTE: two libraries to load are comma-separated; otherwise last mention of the query string arg overwrites the previous -->
    <script type="text/javascript"
      src="http://maps.google.com/maps/api/js?sensor=false&v=3.21.5a&libraries=drawing&signed_in=true&libraries=places,drawing"></script>
    <style type="text/css">
      #map, html, body {
        padding: 0;
        margin: 0;
        height: 100%;
      }
      #panel {
        width: 150px;
        font-family: Arial, sans-serif;
        font-size: 13px;
        float: right;
        margin: 10px;
      }
      #color-palette {
        clear: both;
      }
      .color-button {
        width: 14px;    
        height: 14px;
        font-size: 0;
        margin: 2px;
        float: left;
        cursor: pointer;
      }
      #delete-button {
        margin-top: 5px;
      }
    </style>
    <script type="text/javascript">
      var drawingManager;
      var selectedShape;
      var colors = ['#1E90FF', '#FF0000'];
        var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
        var labelIndex = 0;
      var selectedColor;
      var colorButtons = {};
      var counterDomain = 0;
      var counterRelease = 0;

      
      

      
      
      function updateCurSelText(shape) {
        posstr = "" + selectedShape.position;
        if (typeof selectedShape.position == 'object') {
          posstr = selectedShape.position.toUrlValue();
        }
        
        pathstr = "" + selectedShape.getPath;
        if (typeof selectedShape.getPath == 'function') {
          pathstr = "[ ";
          for (var i = 0; i < selectedShape.getPath().getLength(); i++) {
            // .toUrlValue(5) limits number of decimals, default is 6 but can do more
            pathstr += selectedShape.getPath().getAt(i).toUrlValue() + " , ";
          }
          pathstr += "]";
        }
        
        bndstr = "" + selectedShape.getBounds;

        cntstr = "" + selectedShape.getCenter;


        
        
        if (typeof selectedShape.getBounds == 'function')  {

          var tmpbounds = selectedShape.getBounds();
          cntstr = "" + tmpbounds.getCenter().toUrlValue();
          bndstr = "NE: " + tmpbounds.getNorthEast().toUrlValue() + ' <br />'+
          "SW: "+ tmpbounds.getSouthWest().toUrlValue()+' <br />'+
//           "i = "+selectedShape.getElementById++ ;
          "i = "+labelIndex++ % labels.length ;
//           "i = "+selectedShape.getCenter().toUrlValue() ;


        
        var ne = selectedShape.getBounds().getNorthEast();
        var sw = selectedShape.getBounds().getSouthWest();
if (selectedColor == colors[0]){

                var contentString = '<b>Blue Domain-'+counterDomain+'-Lat/Long: </b><br />' +
	                     'Center: '+(ne.lat()+sw.lat())/2 + ' , ' + (ne.lng()+sw.lng())/2 +' <br />'+
	                     'North-East-corner: '+ ne.lat() + ' , ' + ne.lng() + ' <br />';
        infoWindow = new google.maps.InfoWindow();
        infoWindow.setContent(contentString);
        infoWindow.setPosition(ne);
	    infoWindow.open(map);
        }
        
        
        
        else {

        var contentString = '<b>Red Domain-'+counterRelease+'-Lat/Long: </b><br />' +
	                     'Center: '+(ne.lat()+sw.lat())/2 + ' , ' + (ne.lng()+sw.lng())/2 +' <br />'+
	                     'North-East-corner: '+ ne.lat() + ' , ' + ne.lng() + ' <br />';
        infoWindow = new google.maps.InfoWindow();
        infoWindow.setContent(contentString);
        infoWindow.setPosition(ne);
	    infoWindow.open(map);
        
        }
        

        }

	      
//         curseldiv.innerHTML = bndstr   ;
//         curseldiv.innerHTML = contentString   ;



      }

      
    function deleteInfowindow(infoWindow){
    
        infoWindow.close();
    }
    
    
    
      function clearSelection() {
        if (selectedShape) {
          if (typeof selectedShape.setEditable == 'function') {
            selectedShape.setEditable(false);
          }
          
          selectedShape = null;
        }
      }
      
      
      function setSelection(shape, isNotMarker) {
        clearSelection();
        selectedShape = shape;
        if (isNotMarker)
          shape.setEditable(true);
        selectColor(shape.get('fillColor') || shape.get('strokeColor'));
        updateCurSelText(shape);
        
      }
      
      
      function deleteSelectedShape() {
              deleteInfowindow(infoWindow);
        if (selectedColor == colors[0]){
            if (selectedShape) {
                selectedShape.setMap(null);
                counterDomain = counterDomain -1;
            }
        }
        else {
            if (selectedShape) {
                selectedShape.setMap(null);
                counterRelease = counterRelease -1;
            }
        }
        
      }
      
      
      function selectColor(color) {
        selectedColor = color;
        for (var i = 0; i < colors.length; ++i) {
          var currColor = colors[i];
          colorButtons[currColor].style.border = currColor == color ? '2px solid #789' : '2px solid #fff';
        }
        // Retrieves the current options from the drawing manager and replaces the
        // stroke or fill color as appropriate.

        var rectangleOptions = drawingManager.get('rectangleOptions');
        rectangleOptions.fillColor = color;
        drawingManager.set('rectangleOptions', rectangleOptions);

      }
      
      function setSelectedShapeColor(color) {
        if (selectedShape) {
          if (selectedShape.type == google.maps.drawing.OverlayType.POLYLINE) {
            selectedShape.set('strokeColor', color);
          } else {
            selectedShape.set('fillColor', color);
          }
        }
      }
      
      function makeColorButton(color) {
        var button = document.createElement('span');
        button.className = 'color-button';
        button.style.backgroundColor = color;
        google.maps.event.addDomListener(button, 'click', function() {
          selectColor(color);
          setSelectedShapeColor(color);
        });
        return button;
      }
      
      function buildColorPalette() {
         var colorPalette = document.getElementById('color-palette');
         for (var i = 0; i < colors.length; ++i) {
           var currColor = colors[i];
           var colorButton = makeColorButton(currColor);
           colorPalette.appendChild(colorButton);
           colorButtons[currColor] = colorButton;
         }
         selectColor(colors[0]);
       }
       
      /////////////////////////////////////
      var map; //= new google.maps.Map(document.getElementById('map'), {
      // these must have global refs too!:
      var placeMarkers = [];
      var input;
      var curposdiv;
      var curseldiv;
 
      var infoWindow;
      
      

      
      
      
      function initialize() {
      
        map = new google.maps.Map(document.getElementById('map'), { //var
          zoom: 6,//10,
          center: new google.maps.LatLng(18.59590640319714,105.37530464062493),
          mapTypeId: google.maps.MapTypeId.ROADMAP,
          disableDefaultUI: false,
          zoomControl: true
        });
        curposdiv = document.getElementById('curpos');
        curseldiv = document.getElementById('cursel');

        var polyOptions = {
          strokeWeight: 2.0,
          fillOpacity: 0.35,
          editable: true          
        };
        // Creates a drawing manager attached to the map that allows the user to draw
        // markers, lines, and shapes.

        drawingManager = new google.maps.drawing.DrawingManager({
        
          drawingControl: true,

          drawingControlOptions: {
            position: google.maps.ControlPosition.TOP_CENTER,
            drawingModes: ['rectangle'],
          },

          label: labels[labelIndex++ % labels.length],
//           label: labels[labelIndex++],
//           label: labelIndex++,
          rectangleOptions: polyOptions,
          map: map,
//                         selectedShape.setMap(map),
//                   selectedShape.addListener('bounds_changed', showNewRect),
//         infoWindow = new google.maps.InfoWindow(),

         }
        );
        

             
        
        
        google.maps.event.addListener(drawingManager, 'overlaycomplete', function(e) {
            var isNotMarker = (e.type != google.maps.drawing.OverlayType.MARKER);
            // Switch back to non-drawing mode after drawing a shape.
            drawingManager.setDrawingMode(null);
            // Add an event listener that selects the newly-drawn shape when the user
            // mouses down on it.
            var newShape = e.overlay;
            newShape.type = e.type;
            if (selectedColor == colors[0]){
                counterDomain=counterDomain+1;
            }
            else{
                counterRelease = counterRelease+1;
            }
            

//             google.maps.event.addListener(newShape, 'drag', function() {
//               updateCurSelText(newShape);
//               
//             });
//             google.maps.event.addListener(newShape, 'dragend', function() {
//               updateCurSelText(newShape);
//               
//             });
            google.maps.event.addListener(newShape, 'bounds_changed', function() {
              
              
              
                deleteInfowindow(infoWindow);
              setSelection(newShape, isNotMarker);
              
//               updateCurSelText(newShape);


            });
            google.maps.event.addListener(newShape, 'click', function() {
              
              setSelection(newShape, isNotMarker);
              deleteInfowindow(infoWindow);
              
            });

            setSelection(newShape, isNotMarker);

          //~ }// end if
        });
        // Clear the current selection when the drawing mode is changed, or when the
        // map is clicked.
        google.maps.event.addListener(drawingManager, 'drawingmode_changed', clearSelection);
        google.maps.event.addListener(map, 'click', clearSelection);
        google.maps.event.addDomListener(document.getElementById('delete-button'), 'click', deleteSelectedShape);
        buildColorPalette();
        //~ initSearch();
        // Create the search box and link it to the UI element.
         input = /** @type {HTMLInputElement} */( //var
            document.getElementById('pac-input'));
//         map.controls[google.maps.ControlPosition.TOP_RIGHT].push(input);
        //
        var DelPlcButDiv = document.createElement('div');
        //~ DelPlcButDiv.style.color = 'rgb(25,25,25)'; // no effect?
        DelPlcButDiv.style.backgroundColor = '#fff';
        DelPlcButDiv.style.cursor = 'pointer';
        DelPlcButDiv.innerHTML = 'DEL';
        
        google.maps.event.addDomListener(DelPlcButDiv, 'click', deletePlacesSearchResults);

        // Listen for the event fired when the user selects an item from the
        // pick list. Retrieve the matching places for that item.
 
        // Bias the SearchBox results towards places that are within the bounds of the
        // current map's viewport.
        google.maps.event.addListener(map, 'bounds_changed', function() {
          var bounds = map.getBounds();
          
        }); //////////////////////
      }
      google.maps.event.addDomListener(window, 'load', initialize);
    </script>
  </head>
  <body>
    <div id="panel">
      <div id="color-palette"></div>
      <div>
        <button id="delete-button">Delete Selected Shape</button>
      </div>
    <div id="curpos"></div>
    <div id="cursel"></div>
    
    </div>
    
    <div id="map">A</div>
  </body>
</html>

这是我的build.gradle文件。有明显的问题吗?谢谢!

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/card_container"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@color/white"
    android:gravity="center_vertical"
    android:orientation="vertical"
    android:padding="@dimen/margin_12">


<LinearLayout
    android:id="@+id/ln1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/convert_points_layout"
    android:layout_marginBottom="@dimen/cl_18"
    android:orientation="horizontal"
    android:visibility="visible"
    tools:visibility="visible">

    <LinearLayout
        android:id="@+id/info_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="10"
        android:orientation="vertical">

        <TextView
            android:id="@+id/text1"
            style="@style/Typeface.Small.Bold.TextMidGrey"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:text="jkhdsfjkhj kljsdlf" />

        <TextView
            android:id="@+id/text2"
            style="@style/Typeface.Small.TextMidGrey"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/margin_8"
            android:text="@string/convert_to_voucher_message"
            tools:text="Once you have 150 points, you can convert them to a voucher." />

        <TextView
            android:id="@+id/text3"
            style="@style/Typeface.Small.TextMidGrey"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/margin_8"
            tools:text="Final points collection this quarter: 21/1/17" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/info_arrow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="120"
        android:gravity="right">

        <ImageView
            android:id="@+id/info_Imageview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/btn_arrow_right" />
    </LinearLayout>

</LinearLayout>
</RelativeLayout>

1 个答案:

答案 0 :(得分:0)

如果您的eclipse可执行文件中包含空格,例如“蚀2”。 然后它可能不起作用。