Software Archive
Read-only legacy content
17061 Discussions

Using CraftAR Augmented Reality SDK (iOS: 4.3, Android: 4.2) with Intel XDK

Clifford_B_
Beginner
1,964 Views

I am using the Intel XDK version 3522 and building for the Android Platform

I am trying to use the CraftAR Augmented Reality SDK (iOS: 4.3, Android: 4.2) from Catchoom.com

The following is the error message that I am getting when using the Augmented Reality Cordova SDK with Intel XDK.

* What went wrong:
Execution failed for task ':transformResourcesWithMergeJavaResForRelease'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/NOTICE
File1: .../builds/build.2016-09-15.23-28-59.zu9JhE.tmp/cordova_project/platforms/android/libs/httpcore-4.3.jar
File2: .../builds/build.2016-09-15.23-28-59.zu9JhE.tmp/cordova_project/platforms/android/libs/httpmime-4.3.jar

But the issue is that CraftAR is using the following library files:

Httpcore-4.3.jar
Httpmime-4.3.jar

And Intel XDK is using from maven the following library files:

Httpcore-4.1.jar
Httpmime-4.1.jar

They are not the same version and are being reference twice.

If I remove the 4.3 version from the libs folder of the CraftAR plugin then it will use the 4.1 version which does not have all of the features that CraftAR is using so it will not build properly.

When would Intel XDK be updated to use the new version (4.3) of Httpcore and Httpmime jar files?

Talk to you soon.

Clifford Barnett

0 Kudos
16 Replies
PaulF_IntelCorp
Employee
1,964 Views

This line in the error message:

Duplicate files copied in APK META-INF/NOTICE

Implies that another plugin is pulling in those same lib files and that is what's causing the problem. That other plugin is, for some reason, pulling in the 4.1 files. To test this theory you could remove the other third-party plugins and build again until you isolate which other plugin is pulling in those lib files, or check the plugin.xml files of the plugins.

0 Kudos
Clifford_B_
Beginner
1,964 Views

In the attached file is the full log of the build that fails.

************* Completed processing the main config.xml file (after_prepare)  *****************
ANDROID_HOME=.../android-sdk/
JAVA_HOME=/usr/lib/jvm/java-8-oracle-amd64
Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip
Unzipping /home/builduser/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/gradle-2.2.1-all.zip to /home/builduser/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b
Set executable permissions for: /home/builduser/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/gradle-2.2.1/bin/gradle

Just after this is where it download the httpmime.pom on line 495

Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom

the httpmime.jar on line 553

Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.jar

and httpcore.pom on line 504

Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.pom

and httpcore.jar on line 561

Download https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar

I am not sure where I can change this to not include these files so that I can use the 4.3 versions that CraftAR is using.

0 Kudos
PaulF_IntelCorp
Employee
1,964 Views

I'm not clear on how you were able to make that craftar plugin work. The instructions require that you modify the platforms/android/libs folder, but you do not have access to that folder because it only exists in the cloud build system. See these instructions from the plugin repo:

Android SDK:

  1. Install the plugin
  2. Download the CraftAR Augmented Reality SDK for Android (http://catchoom.com/product/mobile-sdk/#download-mobile-sdk)
  3. Extract the SDK and copy the contents of libs into platforms/android/libs in your project.

The plugin is also quite old, and has likely not been tested against the Cordova Android build system, which has changed dramatically in the past two years.

I'm assuming you are using the plugin I located here > https://github.com/Catchoom/craftar-phonegap < which has the correct ID. Otherwise, there is a download that requires registration, here > http://catchoom.com/documentation/augmented-reality-sdk/cordova-augmented-reality-plugin/ < Is that the one you are using? If so, I am not able to view the plugin to provide additional help, but I suspect a modification to the plugin.xml file in that plugin might fix the issue. If you are willing to share the plugin.xml file from that plugin, via private message, I could take a look and create a test version of the plugin.xml file for you to try.

 

0 Kudos
PaulF_IntelCorp
Employee
1,964 Views

Clifford -- I've issued a request to update the lib files in our build system. I cannot make any promises as to when that will happen. Until that is updated, a workaround is to use Cordova CLI.

0 Kudos
PaulF_IntelCorp
Employee
1,964 Views

Clifford B. wrote:

I would greatly appreciated it if the lib files in your build system could be updated to match what CraftAR is using. Then I could get this application built and into production.

Could you send me some links or examples of how to use the Cordova CLI to build my application.

A request for an update to our build system has been made.

We do not have a good CLI export tool. However, you can convert your app to a PhoneGap Build app or Cordova CLI app fairly easily (the XDK creates a Cordova CLI app, and PhoneGap is also built on top of Cordova CLI):

Your source code should be located in a "www" directory in your project folder. If you are going to use Cordova CLI, then do the following:

  • install Cordova CLI and any required support tools on your dev system (see many Cordova installation articles)
  • create a new blank project using appropriate Cordova CLI commands
  • copy your www folder contents into the new CLI project www folder (you can delete the www contents added by the CLI)
  • add the plugins into your new CLI project using the appropriate commands
  • the majority of the tags inside the various intelxdk.config.*.xml files are compatible with the config.xml file used by CLI, so most can simply be copied directly into that file

 

0 Kudos
Clifford_B_
Beginner
1,964 Views

Hello Paul

With you instruction and the install instruction found here https://www.npmjs.com/package/cordova I was able to get it working.

I made sure that I was using the newer version of Java 1.8.0_92

I was able to update the config.xml file so that my icon was used instead of the default Cordova icon.

The only thing left to do is to get the following user permission setting enabled:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.CAMERA_EXTENDED" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.hardware.camera.autofocus" />

Do you know how I can do this?

0 Kudos
PaulF_IntelCorp
Employee
1,964 Views

The plugins you are using should be taking care of most of those permissions, check their plugin.xml files. If they are not, then there are a variety of ways it can be done. For example:

The second one provides pointers to making a small simple custom plugin that you can use to add the permissions to your build. All that's needed is a plugin.xml file. Follow the links provided in my post on that thread and it should get you going in the right direction.

0 Kudos
Clifford_B_
Beginner
1,964 Views

The permissions have been assigned to the app but you need to turn them on by going to the setting - select the  app - Select the Permissions and then enable the Camera and Storage.

Is there a way that these setting could be enabled when the application is installed.

0 Kudos
Clifford_B_
Beginner
1,964 Views

In comparing different Android Studio apps that I had created I found that if the SDK Version was set to 22 then the user is informed of the permission required for the application to function as expected.  If the SDK Version is set to 23 these permission are not enabled and in the app you need to check if the permission for the Camera for example is enabled before you use it.  If it is not enabled you can prompt the user to request the permission to use the feature and then enable that given permission.

0 Kudos
PaulF_IntelCorp
Employee
1,964 Views

We recommend that you set your target SDK to 21, especially if you are building with Crosswalk.

0 Kudos
Thepjday_A_
Beginner
1,964 Views

Hi - I've asked this question before, but let me ask it again. As you guys move to the IoT version - do we have permission to fork the older version of XDK to keep supporting externally through local Cordova CLI, the stuff that the build servers no longer do and to continue to maintain the libraries that are being deprecated? I realize we will not have any support. I realize that the code is copyright Intel so we can only use it with permission. And we cannot sell it because we would only own the copyright to any parts to augmented. But can we use it? Can we share it? Can we host it on a public github? Can we evolve it? Not looking for an unlimited opensource do-as-you-like license. Looking for permission to continue to evolve what you guys gave us and if you wanted to accept/backport the changes we make, you could do so. We would of course need to host it using the license model that supports your copyright restrictions that you would place on the code.

I just know that I've thoroughly looked at what you have under the hood and I'm pretty sure that given enough time, I can recreate the pipelining to run it locally (I would pretty much have to do that at the command line anyway - and if it's running on the command line, it can be triggered from the GUI).  So rather than EACH of us building the CLI pipeline, we could collaborate and share with each other and build out the local build toolchain.

This really is a great tool. I'd really like to see it not die out for the things we like to use it for (while it continues to evolve in your vision as well). This is the point at which Visual Age for C++ died out. And Optima++. And the list goes on. When the commercial tool developer focuses elsewhere and once great tool falls by the wayside until it is recreated from scratch decades later (Turbo Pascal anyone)?

Anything you can give us that allows us to continue in parallel would be appreciated (even a name change would be acceptable).

Otherwise, each of us continues to do the CLI stuff in silos and we slow down and rebuild the wheel for each of us.

Thanks.

0 Kudos
PaulF_IntelCorp
Employee
1,964 Views

I haven't reviewed the details of the license, which you should find in most of the source files that you're looking at, but, in essence, those license terms are the ones that need to be respected. I will forward your request to management for their feedback.

0 Kudos
Thepjday_A_
Beginner
1,964 Views

I want to know about:

II.1.B says I can use, distribute, but not sell. No mention is made of "modify" I want to be able to use, distribute and MODIFY and DISTRIBUTE MODIFIED copies WITH NOTIFICATION that this is a non-supported version that one may use at their own risk. I do not wish to sell the Intel materials. (Essentially, I want to host a github where others can contribute to the process of maintaining the old build pipelines outside of the Intel servers using libraries that are no longer or not yet or never will be supported by Intel)

Per the Intel license, if I add things to the bundle, those are under my license terms. I can choose to control those as I see fit, but

II.2.B - it says I have to upgrade in a reasonable manner/time. I want to be able to use older versions of the XDK but I do not want to access the Intel Build servers when I do so. This part is unclear.

 

0 Kudos
PaulF_IntelCorp
Employee
1,964 Views

Thepjday -- I've asked some questions of management. Note that since we are in a major holiday season, a reply may take some time.

0 Kudos
Phil_P___Pete_
New Contributor I
1,964 Views

Be curios as to where the discussion about forking this project went.... 

Allowing local builds would have been epic, interfacing with pgb would have been epic.

0 Kudos
PaulF_IntelCorp
Employee
1,964 Views

Phil P. (Pete) wrote:

Be curios as to where the discussion about forking this project went.... 

See this post for your answer > https://software.intel.com/en-us/forums/intel-xdk/topic/700951#comment-1904692 < and many of the other posts in that thread for additional details. Likewise, the release notes > https://software.intel.com/en-us/xdk/docs/release-notes-information-intel-xdk < contain a summary of pointers to important forum posts.

Phil P. (Pete) wrote:

Allowing local builds would have been epic, interfacing with pgb would have been epic.

We're offering the Cordova export feature as a step in that direction. See the doc pages > https://software.intel.com/en-us/xdk/docs/build-xdk-app-with-phonegap-cordova-cli < for some possibilities to make it work with Cordova CLI (it's a bit clunky).

0 Kudos
Reply