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

Google Play/Maps issues on Android

$
0
0

This is an issue that has been plaguing me for awhile now.

Android Version 4.1.2

Google Play Services 5.0.84

Code (I've stripped this to the simplest level for testing)

JS

var Map = require('ti.map');
 
if (Ti.Platform.osname == 'android') {
    var rc = Map.isGooglePlayServicesAvailable();
    switch (rc) {
        case Map.SUCCESS:
            Ti.API.info('Google Play services is installed.');
            var mapview = Map.createView({mapType:Map.NORMAL_TYPE});    
            mapview.region = {
                latitude: 44,
                longitude: -122,
                latitudeDelta: 1,
                longitudeDelta: 1  
            };
            Ti.API.info(mapview.mapType);
            $.main.add(mapview);
            $.facilityLocator.open();
            break;
        case Map.SERVICE_MISSING:
            Ti.API.info('Google Play services is missing. Please install Google Play services from the Google Play store.');
            break;
        case Map.SERVICE_VERSION_UPDATE_REQUIRED:
            Ti.API.info('Google Play services is out of date. Please update Google Play services.');
            break;
        case Map.SERVICE_DISABLED:
           Ti.API.info('Google Play services is disabled. Please enable Google Play services.');
            break;
        case Map.SERVICE_INVALID:
            Ti.API.info('Google Play services cannot be authenticated. Reinstall Google Play services.');
            break;
        default:
            alert('Unknown error.');
            break;
    }
}

Alloy:

<Alloy>
    <Window id='facilityLocator'>
        <View id='main'>
 
        </View>
    </Window>
</Alloy>
tiapp.xml, (I have values instead of the placeholders at the bottom)
<android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
            <!-- 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="APP_ID.permission.MAPS_RECEIVE"/>
            <permission
                android:name="APP_ID.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
            <application>
                <meta-data
                    android:name="com.google.android.maps.v2.API_KEY" android:value="API_KEY"/>
                <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
            </application>
            <supports-screens android:anyDensity="true"/>
        </manifest>
    </android>
Console:
[WARN] :   V8Object: Runtime disposed, cannot set property 'userAgent'
[INFO] :   dalvikvm: Total arena pages for JIT: 11
[INFO] :   dalvikvm: Total arena pages for JIT: 12
[INFO] :   dalvikvm: Total arena pages for JIT: 13
[INFO] :   dalvikvm: Total arena pages for JIT: 14
[INFO] :   dalvikvm: Total arena pages for JIT: 15
[INFO] :   dalvikvm: Total arena pages for JIT: 16
[INFO] :   dalvikvm: Total arena pages for JIT: 17
[INFO] :   dalvikvm: Total arena pages for JIT: 18
[INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.vcsdatabase.vendorapp.VcsActivity@41e1a328
[INFO] :   User ID:203266
[INFO] :   Token:cgggioevhoqj3c422sjvcujkf1
[INFO] :   Choreographer: Skipped 111 frames!  The application may be doing too much work on its main thread.
[WARN] :   InputMethodManager: startInputInner : InputBindResult == null
[INFO] :   Choreographer: Skipped 35 frames!  The application may be doing too much work on its main thread.
[WARN] :   dalvikvm: VFY: unable to resolve static field 1600 (common_google_play_services_install_title) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1596 (common_google_play_services_enable_title) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1611 (common_google_play_services_update_title) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1608 (common_google_play_services_unsupported_title) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1604 (common_google_play_services_network_error_title) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1602 (common_google_play_services_invalid_account_title) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1608 (common_google_play_services_unsupported_title) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1597 (common_google_play_services_install_button) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1594 (common_google_play_services_enable_button) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1609 (common_google_play_services_update_button) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1605 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1599 (common_google_play_services_install_text_tablet) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1598 (common_google_play_services_install_text_phone) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1595 (common_google_play_services_enable_text) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1610 (common_google_play_services_update_text) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1607 (common_google_play_services_unsupported_text) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1603 (common_google_play_services_network_error_text) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1601 (common_google_play_services_invalid_account_text) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1606 (common_google_play_services_unsupported_date_text) in Lcom/google/android/gms/R$string;
[WARN] :   dalvikvm: VFY: unable to resolve static field 1605 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[ERROR] :  GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
[INFO] :   Google Play services is installed.
[INFO] :   1
[WARN] :   dalvikvm: VFY: unable to resolve static field 1616 (MapAttrs) in Lcom/google/android/gms/R$styleable;
[ERROR] :  GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
[INFO] :   I/Google Maps Android API: Google Play services client version: 4323000
[INFO] :   dalvikvm: Could not find method guj.a, referenced from method gqi.a
Google logo and zoom buttons display, but no map.

While the window with the map is open I get this repeatedly:

[INFO] :   BufferQueue: [BQ::queueBuffer] unnamed-4746-0(0x52f4ba28), api=1, queued=1 (drop frame)
What I've tried so far:

Google Maps Android API v2 turned on, API KEY generated and set in tiapp.xml

Google Play Services installed in Android SDK Manager. Version 18

Tried ti.map module version 2.1.2 - 2.1.5.

Tried Titanium SDK version 3.2.0 - 3.2.3.

Tried SHA1 key from dev keytool, tried SHA1 key from published package keystore.

I've seen several developers here and on jira with this same issue but unless I've missed something, have not see a solution that works for me.


Viewing all articles
Browse latest Browse all 8068

Trending Articles