Plugin for GoogleMap fails during compile


#1

The GoogleMap plugin that you recommended will not compile in PhoneGap:

This is the error that is reported by PhoneGap:
Error: Source path does not exist: icons/android/ldpi.png
at updatePathInternal (/cordova/node_modules/cordova-common/src/FileUpdater.js:145:19)
at /cordova/node_modules/cordova-common/src/FileUpdater.js:223:19
at Array.forEach (native)
at Object.updatePaths (/cordova/node_modules/cordova-common/src/FileUpdater.js:221:33)
at updateIcons (/cordova/lib/prepare.js:388:17)
at /cordova/lib/prepare.js:49:9
at _fulfilled (/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (/cordova/node_modules/q/q.js:816:13)
at /cordova/node_modules/q/q.js:624:44

This is the previous discussion thread about this error in NSB:


#2

This has nothing to do with GoogleMaps.

The error message is
Error: Source path does not exist: icons/android/ldpi.png

Do you have that file in your project? With PhoneGap version cli-8.0.0, the icons and splashscreens are required.


#3

It may not have anything to do with GoogleMaps, per se, but the error appears only when I attempt to include the GoogleMaps plugin. Of course, the config.xml within AppStudio contains those icon references:

<platform name='android'>
    <splash src='splash/android/res-long-land-hdpi/splash.png' qualifier='long-land-hdpi' />
    <splash src='splash/android/res-long-land-ldpi/splash.png' qualifier='long-land-ldpi' />
    <splash src='splash/android/res-long-land-mdpi/splash.png' qualifier='long-land-mdpi' />
    <splash src='splash/android/res-long-land-xhdpi/splash.png' qualifier='long-land-xhdpi' />
    <splash src='splash/android/res-long-land-xxhdpi/splash.png' qualifier='long-land-xxhdpi' />
    <splash src='splash/android/res-long-land-xxxhdpi/splash.png' qualifier='long-land-xxxhdpi' />
    <splash src='splash/android/res-long-port-hdpi/splash.png' qualifier='long-port-hdpi' />
    <splash src='splash/android/res-long-port-ldpi/splash.png' qualifier='long-port-ldpi' />
    <splash src='splash/android/res-long-port-mdpi/splash.png' qualifier='long-port-mdpi' />
    <splash src='splash/android/res-long-port-xhdpi/splash.png' qualifier='long-port-xhdpi' />
    <splash src='splash/android/res-long-port-xxhdpi/splash.png' qualifier='long-port-xxhdpi' />
    <splash src='splash/android/res-long-port-xxxhdpi/splash.png' qualifier='long-port-xxxhdpi' />
    <splash src='splash/android/res-notlong-land-hdpi/splash.png' qualifier='notlong-land-hdpi' />
    <splash src='splash/android/res-notlong-land-ldpi/splash.png' qualifier='notlong-land-ldpi' />
    <splash src='splash/android/res-notlong-land-mdpi/splash.png' qualifier='notlong-land-mdpi' />
    <splash src='splash/android/res-notlong-land-xhdpi/splash.png' qualifier='notlong-land-xhdpi' />
    <splash src='splash/android/res-notlong-land-xxhdpi/splash.png' qualifier='notlong-land-xxhdpi' />
    <splash src='splash/android/res-notlong-land-xxxhdpi/splash.png' qualifier='notlong-land-xxxhdpi' />
    <splash src='splash/android/res-notlong-port-hdpi/splash.png' qualifier='notlong-port-hdpi' />
    <splash src='splash/android/res-notlong-port-ldpi/splash.png' qualifier='notlong-port-ldpi' />
    <splash src='splash/android/res-notlong-port-mdpi/splash.png' qualifier='notlong-port-mdpi' />
    <splash src='splash/android/res-notlong-port-xhdpi/splash.png' qualifier='notlong-port-xhdpi' />
    <splash src='splash/android/res-notlong-port-xxhdpi/splash.png' qualifier='notlong-port-xxhdpi' />
    <splash src='splash/android/res-notlong-port-xxxhdpi/splash.png' qualifier='notlong-port-xxxhdpi' />
</platform>

#4

It’s not the Maps which triggers the need for the icons and splashscreens - it’s cli-8.0.0.

The path it complains does not exist is not in the snippet you show.


#5

Here is the entire config.xml, which contains the offending path(s):

<?xml version="1.0" encoding="UTF-8"?>
<widget 
xmlns = "https://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.nsbasic.{id}"
versionCode = "1"
version = "{version}">

<name>{title}</name>
<description>{description}</description>
<preference name="phonegap-version" value="{phoneGapVersion}" />

<!-- Icons -->
<icon src='{icon}' />

<platform name = 'android'>
    <icon src='icons/android/ldpi.png' platform='android' qualifier='ldpi' />
    <icon src='icons/android/mdpi.png' platform='android' qualifier='mdpi' />
    <icon src='icons/android/hdpi.png' platform='android' qualifier='hdpi' />
    <icon src='icons/android/xhdpi.png' platform='android' qualifier='xhdpi' />
    <icon src='icons/android/xxhdpi.png' platform='android' qualifier='xxhdpi' />
</platform>

<platform name = 'ios'>
    <icon src='icons/ios/icon-40.png' platform='ios' width='40' height='40' />
    <icon src='icons/ios/icon-40@2x.png' platform='ios' width='80' height='80' />
    <icon src='icons/ios/icon-50.png' platform='ios' width='50' height='50' />
    <icon src='icons/ios/icon-50@2x.png' platform='ios' width='100' height='100' />
    <icon src='icons/ios/icon-60.png' platform='ios' width='60' height='60' />
    <icon src='icons/ios/icon-60@2x.png' platform='ios' width='120' height='120' />
    <icon src='icons/ios/icon-60@3x.png' platform='ios' width='180' height='180' />
    <icon src='icons/ios/icon-72@.png' platform='ios' width='72' height='72' />
    <icon src='icons/ios/icon-72@2x.png' platform='ios' width='144' height='144' />
    <icon src='icons/ios/icon-72@3x.png' platform='ios' width='216' height='216' />
    <icon src='icons/ios/icon-76.png' platform='ios' width='76' height='76' />
    <icon src='icons/ios/icon-76@2x.png' platform='ios' width='152' height='152' />
    <icon src='icons/ios/icon-small.png' platform='ios' width='29' height='29' />
    <icon src='icons/ios/icon-small@2x.png' platform='ios' width='58' height='58' />
    <icon src='icons/ios/icon.png' platform='ios' width='57' height='57' />
    <icon src='icons/ios/icon@2x.png' platform='ios' width='114' height='114' />
</platform>

<!-- Splash Screens -->
<preference name='SplashScreenDelay' value='2000' />
<preference name='AutoHideSplashScreen' value='true' />
<splash src='{splashscreen}'/>
<plugin name='cordova-plugin-splashscreen' source='npm' />

<platform name='android'>
    <splash src='splash/android/res-long-land-hdpi/splash.png' qualifier='long-land-hdpi' />
    <splash src='splash/android/res-long-land-ldpi/splash.png' qualifier='long-land-ldpi' />
    <splash src='splash/android/res-long-land-mdpi/splash.png' qualifier='long-land-mdpi' />
    <splash src='splash/android/res-long-land-xhdpi/splash.png' qualifier='long-land-xhdpi' />
    <splash src='splash/android/res-long-land-xxhdpi/splash.png' qualifier='long-land-xxhdpi' />
    <splash src='splash/android/res-long-land-xxxhdpi/splash.png' qualifier='long-land-xxxhdpi' />
    <splash src='splash/android/res-long-port-hdpi/splash.png' qualifier='long-port-hdpi' />
    <splash src='splash/android/res-long-port-ldpi/splash.png' qualifier='long-port-ldpi' />
    <splash src='splash/android/res-long-port-mdpi/splash.png' qualifier='long-port-mdpi' />
    <splash src='splash/android/res-long-port-xhdpi/splash.png' qualifier='long-port-xhdpi' />
    <splash src='splash/android/res-long-port-xxhdpi/splash.png' qualifier='long-port-xxhdpi' />
    <splash src='splash/android/res-long-port-xxxhdpi/splash.png' qualifier='long-port-xxxhdpi' />
    <splash src='splash/android/res-notlong-land-hdpi/splash.png' qualifier='notlong-land-hdpi' />
    <splash src='splash/android/res-notlong-land-ldpi/splash.png' qualifier='notlong-land-ldpi' />
    <splash src='splash/android/res-notlong-land-mdpi/splash.png' qualifier='notlong-land-mdpi' />
    <splash src='splash/android/res-notlong-land-xhdpi/splash.png' qualifier='notlong-land-xhdpi' />
    <splash src='splash/android/res-notlong-land-xxhdpi/splash.png' qualifier='notlong-land-xxhdpi' />
    <splash src='splash/android/res-notlong-land-xxxhdpi/splash.png' qualifier='notlong-land-xxxhdpi' />
    <splash src='splash/android/res-notlong-port-hdpi/splash.png' qualifier='notlong-port-hdpi' />
    <splash src='splash/android/res-notlong-port-ldpi/splash.png' qualifier='notlong-port-ldpi' />
    <splash src='splash/android/res-notlong-port-mdpi/splash.png' qualifier='notlong-port-mdpi' />
    <splash src='splash/android/res-notlong-port-xhdpi/splash.png' qualifier='notlong-port-xhdpi' />
    <splash src='splash/android/res-notlong-port-xxhdpi/splash.png' qualifier='notlong-port-xxhdpi' />
    <splash src='splash/android/res-notlong-port-xxxhdpi/splash.png' qualifier='notlong-port-xxxhdpi' />
</platform>

<platform name = 'ios'>
  <splash src='splash/ios/Default.png' width='320' height='480' />
  <splash src='splash/ios/Default@2x.png' width='640' height='960' />
  <splash src='splash/ios/Default-568h@2x.png' width='640' height='1136' />
  <splash src='splash/ios/Default-667h@2x.png' width='750' height='1334' />
  <splash src='splash/ios/Default-Portrait.png' width='768' height='1024' />
  <splash src='splash/ios/Default-Landscape.png' width='1024' height='768' />
  <splash src='splash/ios/Default-Portrait@2x.png' width='1536' height='2048' />
  <splash src='splash/ios/Default-Landscape@2x.png' width='2048' height='1536' />
  <splash src='splash/ios/Default-Portrait-736h@3x.png' width='1242' height='2208' />
  <splash src='splash/ios/Default-Landscape-736h@3x.png' width='2208' height='1242' />
</platform>

<preference name="permissions" value="none"/>
<!-- sample preference specifications -->
<!-- <preference name="autorotate" value="false" readonly="true"/> -->
<!-- <preference name="orientation" value="default" /> -->
<!-- <preference name="fullscreen" value="true" /> -->

<!-- Platforms: Customize as needed. -->
<gap:platforms>
   <gap:platform name="android" />
   <gap:platform name="ios" />
   <gap:platform name="winphone" />
</gap:platforms>

<plugin name="cordova-plugin-sms-receive" source="npm" />

<plugin name="cordova-plugin-googlemaps" spec="2.3.6">
  <variable name="API_KEY_FOR_ANDROID" value="MyKey" />
  <variable name="API_KEY_FOR_IOS" value="" />
  <preference name="phonegap-version" value="cli-8.0.0" />  
  </plugin>
     
  
<plugin name="cordova-plugin-statusbar" source="npm" />
  <preference name="StatusBarOverlaysWebView" value="{phoneGapStatusBarOverlay}" />
  <preference name="StatusBarBackgroundColor" value="{phoneGapStatusBarColor}" />
  <preference name="StatusBarStyle" value="{phoneGapStatusBarStyle}" />

<plugin name="cordova-plugin-whitelist" source="npm" />
  <allow-navigation href="*" />
  <access origin="*" />
</widget>

#6

Does the file exist in your project folder?

Are these two lines in your manifest property?

icons
splash

#7

Re: “Does the file exist in your project folder?” Which file are you referring to?

The manifest property is empty. The “manifest file” is specified as: appcache.


#8

One other bit of information: The build.log shows an error:

(node:15580) UnhandledPromiseRejectionWarning: CordovaError: No platforms added to this project. Please use cordova platform add <platform>.
at Object.preProcessOptions (C:\Users\Allan\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\util.js:312:15)
at C:\Users\Allan\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\emulate.js:30:32
at _fulfilled (C:\Users\Allan\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\Allan\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\Allan\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:749:13)
at C:\Users\Allan\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:810:14
at flush (C:\Users\Allan\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
(node:15580) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15580) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


#9

Please add those two lines to the manifest property.


#10

Thanks. I tried that, and received this error for each of those lines: “Could not find file in manifest”

Do I need to create (or import) a file to satisfy that?


#11

Can you attach a screenshot of your project folder? There should be directories named icons and splash.


#12

Neither of those directories is there (see attached). They’re not in the sub-folders, either.


#13

As an experiment, I copied those two folders (icons & splash) to my project folder. It churned away on the compilation much longer this time, but ultimately returned an error (albeit, a different one);

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:processDebugManifest’.

Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:tbxml-android:] /.gradle/caches/transforms-1/files-1.1/tbxml-android.aar/33b87c5bb1a881c8e05e2ce88e4785cd/AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project’s minSdk version to at least 19,
or use tools:overrideLibrary=“za.co.twyst” to force usage (may lead to runtime failures)


#14

So the files do not exist - PhoneGap is right.

You need to have icon and splash folders, as specified in your configxml.


#15

Please see my previous post (almost simultaneous with your reply).

I copied those folders from the PhoneGap samples of the NSB installation folder.

It would seem that I should do that for any future projects that involve PhoneGap…


#16

How (where) can I make that recommended change? I can’t find any file that makes reference to “minSDK” version. Thanks.


#17

This is another issue. Can you open a fresh thread?


#18

Never mind. I have determined that NSB isn’t suitable. You’re more interested in process than results.


#19

We’re trying to make this discussion board useful for others. To do so, topics need to discuss separate issues. We are no different than any other board in this - they all have similar requirements.

PhoneGap is not a product of our company. We’re limited in how much support we can provide for it, especially for free. We have no control over how they design and support it. A lot of the pain you have been experiencing has nothing to do with AppStudio - it’s recent changes to PhoneGap.


#20

I know that PhoneGap is separate, but in this case it’s the only way to get a Google Map to work. NSB places heavy dependency on plugins (including PhoneGap) to achieve its promised functionalities. It’s part of the charm of AppStudio, but also its weakness. They are intertwined. I would have loved to use your native Google Map, but it isn’t compatible with anything that has been compiled with PhoneGap

You’re right; it’s essential to keep topics within their own threads. In this case, the topic has evolved as a progression of where the original problem (not being able to use your Google Map with PhoneGap compilation) has led. It has been a path. First, PhoneGap wasn’t recognizing a variable, then not having a path satisfied, because of missing folders (icons and splash). If there is a document about folder requirement, I haven’t found it. After taking care of that, I came to where I am now: A minSDK version problem, for which there is no apparent documentation, or property in NSB. You have a very nice programming environment, but I have come to find that dependence on PhoneGap is a mixed blessing. Thanks for your reply.