Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Alloy Map View Error - Project Does Not Build

$
0
0
  • Application Type: Mobile

    • Titanium SDK: 3.1.3.v20130918120054
    • Platform and Version: Android 4.4.2
    • Device: Nexus 4
    • Host OS: OSX 10.9
    • Titanium Studio: 3.1.3.201309132423

    • I have installed the module for Google Maps that replaces the Titanium Maps functionality as described in the Alloy Map documentation.

    • I have updated my TiApp.xml file with appropriate permissions and settings per the documentation.
    • My alloy xml file contains the following code:
      <Alloy>
          <Window class="container" title="Home" navBarHidden="true" onOpen="Init">
              <Toolbar platform="ios"><Label class="header">Home</Label></Toolbar>
              <View layout="absolute">
                  <View id="mapView" ns="Ti.Map"></View>
              </View>
          </Window>
      </Alloy>
    • My controller contains the following code:
      function Init(){
       
      }
      $.AlertDetailView.open();
    • My tiapp.xml is as follows:
      <?xml version="1.0" encoding="UTF-8"?>
      <ti:app xmlns:ti="http://ti.appcelerator.org">
          <property name="acs-oauth-secret-production" type="string"></property>
          <property name="acs-oauth-key-production" type="string"></property>
          <property name="acs-api-key-production" type="string"></property>
          <property name="acs-oauth-secret-development" type="string"></property>
          <property name="acs-oauth-key-development" type="string"></property>
          <property name="acs-api-key-development" type="string"></property>
       
          <id>xyz</id>
          <name>BairFinder</name>
          <version>1.0.0.1</version>
          <publisher>bparr</publisher>
          <url>http://</url>
          <description>not specified</description>
          <copyright>2013 by bparr</copyright>
          <icon>appicon.png</icon>
          <persistent-wifi>false</persistent-wifi>
          <prerendered-icon>false</prerendered-icon>
          <statusbar-style>default</statusbar-style>
          <statusbar-hidden>false</statusbar-hidden>
          <fullscreen>false</fullscreen>
          <navbar-hidden>false</navbar-hidden>
          <analytics>true</analytics>
          <guid>guid</guid>
          <property name="ti.ui.defaultunit" type="string">system</property>
          <iphone>
              <orientations device="iphone">
                  <orientation>Ti.UI.PORTRAIT</orientation>
              </orientations>
              <orientations device="ipad">
                  <orientation>Ti.UI.PORTRAIT</orientation>
                  <orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
                  <orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
                  <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
              </orientations>
              <min-ios-ver>6.0</min-ios-ver>
              <plist>
                  <dict>
                      <key>UIBackgroundModes</key>
                      <array>
                          <string>location</string>
                      </array>
                      <key>UIRequiredDeviceCapabilities</key>
                      <array>
                          <string>location-services</string>
                          <string>gps</string>
                      </array>
                  </dict>
                  <dict>
                      <key>NSLocationUsageDescription</key>
                      <string>GPS access for BringHome100</string>
                  </dict>
              </plist>
          </iphone>
          <android xmlns:android="http://schemas.android.com/apk/res/android">
              <manifest>
                  <supports-screens android:anyDensity="false"/>
                  <!-- GCM connects to Google Services. -->
                  <uses-permission android:name="android.permission.INTERNET"/>
                  <!-- GCM requires a Google account. -->
                  <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
                  <!-- Keeps the processor from sleeping when a message is received. -->
                  <uses-permission android:name="android.permission.WAKE_LOCK"/>
                  <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
                  <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
                  <uses-permission android:name="android.permission.VIBRATE"/>
                  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
                  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
                  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
                  <application>
                      <service android:name="com.appcelerator.cloud.push.PushService"/>
                  </application>
                  <!-- Allows the API to cache data -->
                  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
                  <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
                  <!-- Specify OpenGL ES 2.0 as a requirement -->
                  <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
                  <!-- Replace com.domain.appid with your application ID -->
                  <uses-permission android:name="x.y.z.permission.MAPS_RECEIVE"/>
                  <permission
                      android:name="x.y.z.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
                  <application>
                      <!-- Replace "PASTE YOUR GOOGLE MAPS API KEY HERE" with the Google API key you obtained -->
                      <meta-data
                          android:name="com.google.android.maps.v2.API_KEY" android:value="api key from google removed for post"/>
                  </application>
              </manifest>
          </android>
          <mobileweb>
              <precache/>
              <splash>
                  <enabled>true</enabled>
                  <inline-css-images>true</inline-css-images>
              </splash>
              <theme>default</theme>
          </mobileweb>
          <modules>
              <module platform="iphone">bencoding.basicgeo</module>
              <module platform="android">bencoding.basicgeo</module>
              <module platform="iphone">com.0x82.testflight</module>
              <module platform="commonjs">ti.cloud</module>
              <module platform="android">ti.cloudpush</module>
              <module platform="android">ti.map</module>
          </modules>
          <deployment-targets>
              <target device="android">true</target>
              <target device="blackberry">false</target>
              <target device="ipad">true</target>
              <target device="iphone">true</target>
              <target device="mobileweb">false</target>
              <target device="tizen">false</target>
          </deployment-targets>
          <sdk-version>3.1.3.v20130918120054</sdk-version>
          <plugins>
              <plugin version="1.0">ti.alloy</plugin>
          </plugins>
          <property name="ti.deploytype">test</property>
      </ti:app>
    • I get the following error when attempting to build and run on my machine
      [ERROR] System Error while compiling Android classes.dex
      [ERROR] UNEXPECTED TOP-LEVEL EXCEPTION:
      [ERROR] java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/GoogleMap$OnMapClickListener;
      [ERROR]     at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
      [ERROR]     at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
      [ERROR]     at com.android.dx.command.dexer.Main.processClass(Main.java:490)
      [ERROR]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
      [ERROR]     at com.android.dx.command.dexer.Main.access$400(Main.java:67)
      [ERROR]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
      [ERROR]     at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
      [ERROR]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
      [ERROR]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
      [ERROR]     at com.android.dx.command.dexer.Main.processOne(Main.java:422)
      [ERROR]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
      [ERROR]     at com.android.dx.command.dexer.Main.run(Main.java:209)
      [ERROR]     at com.android.dx.command.dexer.Main.main(Main.java:174)
      [ERROR]     at com.android.dx.command.Main.main(Main.java:91)
      [ERROR] 1 error; aborting
      [ERROR] :  Build process exited with code 1
      [ERROR] :  Project failed to build after 45s 536ms
      Any suggestions on where to start?

Thanks, B


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>