0

I'm currently working on getting an old Titanium SDK 1.x app working in the modern era on Titanium SDK 3.1.2. One of the challenges I've managed to find myself stuck on is after upgrading from Google Android Maps API v1 to v2 I'm consistently getting this error:

The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

I have installed in the ADK the 18.0.1 build tools as well as the required Google Play Services extras package. Uninstalling/reinstalling does nothing useful, and as far as I can tell there's no way to manually include the Play Store Services library in Titanium.

For reference I followed the instructions here to set up the Maps API v2 in the app. The following is what is in my tiapp.xml file (I replaced the actual package names):

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-permission android:name="com.example.permission.MAPS_RECEIVE"/>
<permission android:name="com.example.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<application>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="###"/>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"/>
</application>

Note that the correct certificates and correct API have been used within the Google API Console.

Does anyone have any idea why I might be unable to load the Google Play Services in my Titanium app?

Thanks in advance!

Community
  • 1
  • 1
Paul W
  • 1
  • 1
  • 1

2 Answers2

0

The maps only work on device. Are you running this in the emulator?

I have an additional permission set "android.permission.ACCESS_NETWORK_STATE"

Also double check to ensure your appId is correct and matches what is in your tiapp.xml file

<android xmlns:android="http://schemas.android.com/apk/res/android">
    <tool-api-level>14</tool-api-level>
    <manifest>
        <!-- uses-sdk android:minSdkVersion="11" android:targetSdkVersion="14" -->
        <!-- Camera Access -->
        <uses-permission android:name="android.permission.CAMERA"/>
        <uses-feature android:name="android.hardware.camera"/>
        <uses-feature android:name="android.hardware.camera.autofocus"/>
        <!-- Allows the API to download data from Google Map servers -->
        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
        <!-- 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.wiley.TIgram.permission.MAPS_RECEIVE"/>
        <permission android:name="com.wiley.TIgram.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
        <application android:hardwareAccelerated="true" android:theme="@android:style/Theme.Holo.Light">
            <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="XXXXXXXXXXXXXXXXXXXXXXXX"/>
            <activity android:configChanges="keyboardHidden|orientation" android:name="ti.modules.titanium.media.TiCameraActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
        </application>
    </manifest>
</android>
Aaron Saunders
  • 33,180
  • 5
  • 60
  • 80
0

This is more of a suggestion than an answer but I got the same error and it made me bark up the wrong tree for quite some time before I realized I had an error somewhere else in the code. In my case, there was a view element that had a null attribute, though that wasn't clear from the stack trace. The Play Services error you pasted above was visible early on but it seems that the compiler will ignore it if the service is found.

:(

To make matters more confusing, I built the same code for iOS and there was no error.

lee
  • 417
  • 3
  • 13