<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Matheus -- our Android build in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121651#M76278</link>
    <description>&lt;P&gt;Matheus -- our Android build system now includes a fix for an issue in the standard Cordova build system that allows the push plugin you are referencing to work, &lt;STRONG&gt;&lt;EM&gt;without a gradle script!&lt;/EM&gt;&lt;/STRONG&gt; This fix &lt;STRONG&gt;&lt;EM&gt;only works&lt;/EM&gt;&lt;/STRONG&gt; for plugins that include a gradle script designed to set the default App ID, like that one in the phonegap-plugin-push plugin.&lt;/P&gt;

&lt;P&gt;In this particular example, the gradle script that's been added to the plugin looks like this (it is named &lt;A href="https://github.com/phonegap/phonegap-plugin-push/blob/1.6.3/push.gradle" target="_blank"&gt;push.gradle&lt;/A&gt;):&lt;/P&gt;

&lt;PRE class="brush:java;"&gt;import java.util.regex.Pattern

def doExtractStringFromManifest(name) {
    def manifestFile = file(android.sourceSets.main.manifest.srcFile)
    def pattern = Pattern.compile(name + "=\"(.*?)\"")
    def matcher = pattern.matcher(manifestFile.getText())
    matcher.find()
    return matcher.group(1)
}

android {
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
        }
    }

    defaultConfig {
        applicationId = doExtractStringFromManifest("package")
    }
}&lt;/PRE&gt;

&lt;P&gt;All this gradle script is doing is inserting your app's "package ID" (which is what you set in the Build Settings as the "App ID") into a variable called "applicationID" for use by the build system.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;You're probably asking, how does this help me? What do I do now? Good question.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Here's what you need to do:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;download a ZIP of the plugin version you want to use (e.g. &lt;A href="https://github.com/phonegap/phonegap-plugin-push/archive/1.6.3.zip"&gt;version 1.6.3&lt;/A&gt;)&lt;/LI&gt;
	&lt;LI&gt;unzip that plugin onto your local hard drive&lt;/LI&gt;
	&lt;LI&gt;&lt;A href="https://github.com/phonegap/phonegap-plugin-push/blob/1.6.3/plugin.xml#L87" target="_blank"&gt;remove the &amp;lt;framework&amp;gt; line that references "push.gradle"&lt;/A&gt; from the plugin.xml file&lt;/LI&gt;
	&lt;LI&gt;add the plugin as a "local" plugin into your project (see image below)&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2016-05-10 at 2.07.47 PM.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8827iA1C2C50154DF5088/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screen Shot 2016-05-10 at 2.07.47 PM.png" alt="Screen Shot 2016-05-10 at 2.07.47 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;In this case, you should also be prompted to define a variable that the plugin needs. If you know that variable's name (it's called &lt;STRONG&gt;SENDER_ID&lt;/STRONG&gt; for this plugin), you can add it using the "+" icon in the image above, and avoid the prompt. If the plugin add was successful, you'll find something like this in the Projects tab:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2016-05-10 at 2.55.52 PM.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8828i76264742A50633DF/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screen Shot 2016-05-10 at 2.55.52 PM.png" alt="Screen Shot 2016-05-10 at 2.55.52 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;If you are really curious, you can inspect the AndroidManifest.xml file that is included &lt;EM&gt;inside&lt;/EM&gt; your built APK file (you'll have to use a tool like apktool to extract and reconstruct it from you APK file). You should see something like the following in the highlighted line (which should match your App ID, in this example, the App ID was "io.cordova.hellocordova"):&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2016-05-10 at 4.08.05 PM.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8829i6DD5A42B748591E7/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screen Shot 2016-05-10 at 4.08.05 PM.png" alt="Screen Shot 2016-05-10 at 4.08.05 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;If you see the following App ID, it means something went wrong. This is a default App ID that ends up causing a collision on end-user devices when another app that is using Google Services use this same default App ID:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2016-05-10 at 4.08.05 PM copy.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8830iE1AC7A883A7678F9/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screen Shot 2016-05-10 at 4.08.05 PM copy.png" alt="Screen Shot 2016-05-10 at 4.08.05 PM copy.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2016 23:44:09 GMT</pubDate>
    <dc:creator>PaulF_IntelCorp</dc:creator>
    <dc:date>2016-05-10T23:44:09Z</dc:date>
    <item>
      <title>Build fails using third-part plugins</title>
      <link>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121648#M76275</link>
      <description>&lt;P&gt;I had several problems when trying to use third-part plugins, specially small plugins (with short amount of contribuitors) on github. I point the git repo on "Cordova Hydrid Mobile App Settings" and try to build. I got this error:&lt;/P&gt;

&lt;H3 style="margin-bottom: 6px; box-sizing: border-box; font-family: intelXDK; font-size: 18px; line-height: 22px; color: rgb(0, 113, 197); widows: auto; background-color: rgb(34, 34, 34);"&gt;Build Log&lt;/H3&gt;

&lt;DIV class="log-list" style="margin: 0px; padding: 0px; box-sizing: border-box; font-family: intelXDK; color: rgb(208, 208, 208); font-size: 14px; line-height: normal; widows: auto; background-color: rgb(34, 34, 34);"&gt;
	&lt;UL style="margin-bottom: 0px; margin-left: 20px; box-sizing: border-box; line-height: 1.6em;"&gt;
		&lt;LI style="box-sizing: border-box;"&gt;&lt;SPAN style="margin: 0px; padding: 0px; box-sizing: border-box;"&gt;Building a Cordova 5.4.1 application.&lt;/SPAN&gt;&lt;/LI&gt;
		&lt;LI style="box-sizing: border-box;"&gt;&lt;SPAN style="margin: 0px; padding: 0px; box-sizing: border-box;"&gt;Using platform cordova-ios 4.0.1.&lt;/SPAN&gt;&lt;/LI&gt;
		&lt;LI style="box-sizing: border-box;"&gt;&lt;SPAN style="margin: 0px; padding: 0px; box-sizing: border-box;"&gt;The application name is "CS i9"&lt;/SPAN&gt;&lt;/LI&gt;
		&lt;LI style="box-sizing: border-box;"&gt;&lt;SPAN style="margin: 0px; padding: 0px; box-sizing: border-box;"&gt;The package name is "com.compusoft.loginUI"&lt;/SPAN&gt;&lt;/LI&gt;
		&lt;LI style="box-sizing: border-box;"&gt;&lt;SPAN style="margin: 0px; padding: 0px; box-sizing: border-box;"&gt;Plugin "cordova-plugin-statusbar" (2.1.0) installed.&lt;/SPAN&gt;&lt;/LI&gt;
		&lt;LI style="box-sizing: border-box;"&gt;&lt;SPAN style="margin: 0px; padding: 0px; box-sizing: border-box;"&gt;Plugin "cordova-plugin-device" (1.1.1) installed.&lt;/SPAN&gt;&lt;/LI&gt;
		&lt;LI style="box-sizing: border-box;"&gt;&lt;SPAN style="margin: 0px; padding: 0px; box-sizing: border-box;"&gt;Plugin "cordova-plugin-splashscreen" (3.2.0) installed.&lt;/SPAN&gt;&lt;/LI&gt;
		&lt;LI style="box-sizing: border-box;"&gt;&lt;SPAN style="margin: 0px; padding: 0px; box-sizing: border-box;"&gt;Plugin "cordova-plugin-dialogs" (1.2.0) installed.&lt;/SPAN&gt;&lt;/LI&gt;
		&lt;LI class="error-item" style="box-sizing: border-box; color: rgb(187, 57, 57);"&gt;&lt;SPAN style="margin: 0px; padding: 0px; box-sizing: border-box;"&gt;Error: Plugin cordova-plugin-gcmpushplugin cannot be added. The plugin contains Gradle scripts.&lt;/SPAN&gt;&lt;/LI&gt;
	&lt;/UL&gt;
&lt;/DIV&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;If I download the plugin and install manually, I also get the same error. This follows for most of pluggins i'm using. The one with problem here is this:&amp;nbsp;https://github.com/gonzaloaune/GCMPushPlugin.&lt;/P&gt;

&lt;P&gt;I'm using Cordova 5.4.1 (also tried with 5.1.1), and using XDK build 3240. How can I install these plugins?&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2016 20:12:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121648#M76275</guid>
      <dc:creator>Matheus_O_</dc:creator>
      <dc:date>2016-05-09T20:12:47Z</dc:date>
    </item>
    <item>
      <title>Our build system does not</title>
      <link>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121649#M76276</link>
      <description>&lt;P&gt;Our build system does not support plugins that include gradle scripts. This is due to the security risk that gradle scripts present to a cloud-based system. Anything can be put in those scripts, which could then be used to compromise the build system and your account information. We are working on a more secure build system that would allow us to run gradle scripts. Unfortunately, we do not yet have such a system in place.&lt;/P&gt;

&lt;P&gt;In the meantime, the only way around this is to clone the plugin to your local system and modify it so that it does not require the gradle script. This means that you must determine what the gradle script is doing and change the plugin so it includes those pieces and parts. Then you can add the plugin by importing it as a local plugin.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 17:49:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121649#M76276</guid>
      <dc:creator>PaulF_IntelCorp</dc:creator>
      <dc:date>2016-05-10T17:49:11Z</dc:date>
    </item>
    <item>
      <title>Any prediction when PhoneGap</title>
      <link>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121650#M76277</link>
      <description>&lt;P&gt;Any prediction when PhoneGap's PushPlugin version 1.6.0 will be supported? I need some new resources urgently for my application.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 19:36:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121650#M76277</guid>
      <dc:creator>Matheus_O_</dc:creator>
      <dc:date>2016-05-10T19:36:46Z</dc:date>
    </item>
    <item>
      <title>Matheus -- our Android build</title>
      <link>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121651#M76278</link>
      <description>&lt;P&gt;Matheus -- our Android build system now includes a fix for an issue in the standard Cordova build system that allows the push plugin you are referencing to work, &lt;STRONG&gt;&lt;EM&gt;without a gradle script!&lt;/EM&gt;&lt;/STRONG&gt; This fix &lt;STRONG&gt;&lt;EM&gt;only works&lt;/EM&gt;&lt;/STRONG&gt; for plugins that include a gradle script designed to set the default App ID, like that one in the phonegap-plugin-push plugin.&lt;/P&gt;

&lt;P&gt;In this particular example, the gradle script that's been added to the plugin looks like this (it is named &lt;A href="https://github.com/phonegap/phonegap-plugin-push/blob/1.6.3/push.gradle" target="_blank"&gt;push.gradle&lt;/A&gt;):&lt;/P&gt;

&lt;PRE class="brush:java;"&gt;import java.util.regex.Pattern

def doExtractStringFromManifest(name) {
    def manifestFile = file(android.sourceSets.main.manifest.srcFile)
    def pattern = Pattern.compile(name + "=\"(.*?)\"")
    def matcher = pattern.matcher(manifestFile.getText())
    matcher.find()
    return matcher.group(1)
}

android {
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
        }
    }

    defaultConfig {
        applicationId = doExtractStringFromManifest("package")
    }
}&lt;/PRE&gt;

&lt;P&gt;All this gradle script is doing is inserting your app's "package ID" (which is what you set in the Build Settings as the "App ID") into a variable called "applicationID" for use by the build system.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;You're probably asking, how does this help me? What do I do now? Good question.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Here's what you need to do:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;download a ZIP of the plugin version you want to use (e.g. &lt;A href="https://github.com/phonegap/phonegap-plugin-push/archive/1.6.3.zip"&gt;version 1.6.3&lt;/A&gt;)&lt;/LI&gt;
	&lt;LI&gt;unzip that plugin onto your local hard drive&lt;/LI&gt;
	&lt;LI&gt;&lt;A href="https://github.com/phonegap/phonegap-plugin-push/blob/1.6.3/plugin.xml#L87" target="_blank"&gt;remove the &amp;lt;framework&amp;gt; line that references "push.gradle"&lt;/A&gt; from the plugin.xml file&lt;/LI&gt;
	&lt;LI&gt;add the plugin as a "local" plugin into your project (see image below)&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2016-05-10 at 2.07.47 PM.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8827iA1C2C50154DF5088/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screen Shot 2016-05-10 at 2.07.47 PM.png" alt="Screen Shot 2016-05-10 at 2.07.47 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;In this case, you should also be prompted to define a variable that the plugin needs. If you know that variable's name (it's called &lt;STRONG&gt;SENDER_ID&lt;/STRONG&gt; for this plugin), you can add it using the "+" icon in the image above, and avoid the prompt. If the plugin add was successful, you'll find something like this in the Projects tab:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2016-05-10 at 2.55.52 PM.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8828i76264742A50633DF/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screen Shot 2016-05-10 at 2.55.52 PM.png" alt="Screen Shot 2016-05-10 at 2.55.52 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;If you are really curious, you can inspect the AndroidManifest.xml file that is included &lt;EM&gt;inside&lt;/EM&gt; your built APK file (you'll have to use a tool like apktool to extract and reconstruct it from you APK file). You should see something like the following in the highlighted line (which should match your App ID, in this example, the App ID was "io.cordova.hellocordova"):&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2016-05-10 at 4.08.05 PM.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8829i6DD5A42B748591E7/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screen Shot 2016-05-10 at 4.08.05 PM.png" alt="Screen Shot 2016-05-10 at 4.08.05 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;If you see the following App ID, it means something went wrong. This is a default App ID that ends up causing a collision on end-user devices when another app that is using Google Services use this same default App ID:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screen Shot 2016-05-10 at 4.08.05 PM copy.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/8830iE1AC7A883A7678F9/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="Screen Shot 2016-05-10 at 4.08.05 PM copy.png" alt="Screen Shot 2016-05-10 at 4.08.05 PM copy.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 23:44:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121651#M76278</guid>
      <dc:creator>PaulF_IntelCorp</dc:creator>
      <dc:date>2016-05-10T23:44:09Z</dc:date>
    </item>
    <item>
      <title>Thank you for your attention</title>
      <link>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121652#M76279</link>
      <description>&lt;P&gt;Thank you for your attention,Paul, that works!&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 17:40:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Build-fails-using-third-part-plugins/m-p/1121652#M76279</guid>
      <dc:creator>Matheus_O_</dc:creator>
      <dc:date>2016-05-11T17:40:26Z</dc:date>
    </item>
  </channel>
</rss>

