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

Android Map Module crashing App

$
0
0

I have been battling this for a couple weeks. I have read all previous questions and all things say the same thing. That I need to enable Google Maps v2 on my app and ensure my key is in my in my tiapp.xml. I have done both.

Here is everything I have, I am sure I missed something, but any help would be appreciated. Here is the test app I created that still stops when I launch it. I am using a Galaxy S5 for testing.

Like I said, I have Google Maps Android API v2 turned on on my Google API console, and I have my SHA1 in the Allowed Apps.

app.js

var Map = require('ti.map');
 
var win = Ti.UI.createWindow({
 
});
 
 
win.open();
 
var mapview = Map.createView({
        mapType : Map.STANDARD_TYPE,
        region : {
            latitude : 40.355,
            longitude : -112,
            latitudeDelta : 0.3,
            longitudeDelta : 0.3
        },
        animate : true,
        regionFit : true,
        userLocation : true
    });
 
win.add(mapview);
tiapp.xml
<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
    <id>com.adzimadev.shootipediapro</id>
    <name>Test Map</name>
    <version>1.0</version>
    <publisher>chrisadzima</publisher>
    <url>http://</url>
    <description>not specified</description>
    <copyright>2014 by chrisadzima</copyright>
    <icon>appicon.png</icon>
    <fullscreen>false</fullscreen>
    <navbar-hidden>false</navbar-hidden>
    <analytics>true</analytics>
    <guid>8cca2b59-5001-4ea4-b049-eee1e9eec1ed</guid>
    <property name="ti.ui.defaultunit" type="string">dp</property>
    <ios>
        <plist>
            <dict>
                <key>UISupportedInterfaceOrientations~iphone</key>
                <array>
                    <string>UIInterfaceOrientationPortrait</string>
                </array>
                <key>UISupportedInterfaceOrientations~ipad</key>
                <array>
                    <string>UIInterfaceOrientationPortrait</string>
                    <string>UIInterfaceOrientationPortraitUpsideDown</string>
                    <string>UIInterfaceOrientationLandscapeLeft</string>
                    <string>UIInterfaceOrientationLandscapeRight</string>
                </array>
                <key>UIRequiresPersistentWiFi</key>
                <false/>
                <key>UIPrerenderedIcon</key>
                <false/>
                <key>UIStatusBarHidden</key>
                <false/>
                <key>UIStatusBarStyle</key>
                <string>UIStatusBarStyleDefault</string>
            </dict>
        </plist>
    </ios>
    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest android:installLocation="preferExternal"
            android:versionCode="4" android:versionName="2.2">
            <!-- Allows the API to download data from Google Map servers -->
            <uses-permission android:name="android.permission.INTERNET"/>
            <!-- Allows the API to cache data -->
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
            <!-- Use GPS for device location -->
            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
            <!-- Use Wi-Fi or mobile connection for device location -->
            <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
            <!-- Allows the API to access Google web-based services -->
            <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="com.adzimadev.shootipediapro.permission.MAPS_RECEIVE"/>
            <permission
                android:name="com.adzimadev.shootipediapro.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="AIzaSyCdR8b3TrcxIPL-C6VuTAI0XERG7XDskWU"/>
            </application>
            <uses-sdk android:minSdkVersion="11"/>
            <!-- This tells the Marketplace and the system what versions of Android your app supports -->
        </manifest>
    </android>
    <mobileweb>
        <precache/>
        <splash>
            <enabled>true</enabled>
            <inline-css-images>true</inline-css-images>
        </splash>
        <theme>default</theme>
    </mobileweb>
    <modules>
        <module platform="iphone">ti.map</module>
        <module platform="android">ti.map</module>
    </modules>
    <deployment-targets>
        <target device="android">true</target>
        <target device="blackberry">false</target>
        <target device="ipad">false</target>
        <target device="iphone">false</target>
        <target device="mobileweb">false</target>
        <target device="tizen">false</target>
    </deployment-targets>
    <sdk-version>3.2.3.GA</sdk-version>
</ti:app>
Error: [WARN] : dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41736da0) [ERROR] : TiApplication: (main) [545,545] Sending event: exception on thread: main msg:java.lang.NumberFormatException: Unable to convert null; Titanium 3.2.3,2014/04/22 10:17,b958a70 [ERROR] : TiApplication: java.lang.NumberFormatException: Unable to convert null [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiConvert.toInt(TiConvert.java:407) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollDict.getInt(KrollDict.java:139) [ERROR] : TiApplication: at ti.map.TiUIMapView.processMapProperties(TiUIMapView.java:144) [ERROR] : TiApplication: at ti.map.TiUIMapView.onViewCreated(TiUIMapView.java:111) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiUIFragment.handleMessage(TiUIFragment.java:65) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:136) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5579) [ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:515) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) [ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method) [ERROR] : File: fail readDirectory() errno=2

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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