This is a migrated thread and some comments may be shown as answers.

MapBox is giving Build Error

1 Answer 68 Views
Sample Applications
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 08 Oct 2015, 10:22 PM

The sample app for MapBox is now giving a build error.  I removed it from my Android phone and removed project from MyApp.

Trying to build Android App Package debug.  I am doing as App Package, not Companion because of custom plugins.  This was done using Chrome browser running web Platform.

Server exception
Project "Mapbox demo.tmp.proj" (default targets): android Build Tooling revision 2015.09.30.2r Warning: Note: Some input files use or override a deprecated API. Warning: Note: Recompile with -Xlint:deprecation for details. Warning: Note: Some input files use or override a deprecated API. Warning: Note: Recompile with -Xlint:deprecation for details. Warning: FAILURE: Warning: Build failed with an exception. Warning: * What went wrong: Warning: Execution failed for task ':mergeArmv7DebugResources'. Warning: > Warning: /tmp/builds/tXezzd6CfbHVdyno8L/app/res/values/mapboxstrings.xml: Error: Found item String/mapbox_accesstoken more than one time Warning: * Try: Warning: Run with Warning: --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Warning: /tmp/builds/tXezzd6CfbHVdyno8L/app/cordova/node_modules/q/q.js:126 Warning: throw e; Warning: ^ Error code 1 for command: /tmp/builds/tXezzd6CfbHVdyno8L/app/gradlew with args: cdvBuildDebug,-b,/tmp/builds/tXezzd6CfbHVdyno8L/app/build.gradle,-Dorg.gradle.daemon=true,-PcdvBuildArch=armv7,-PcdvBuildMultipleApks=true Error: /tmp/builds/tXezzd6CfbHVdyno8L/app/res/values/mapboxstrings.xml: Error: Found item String/mapbox_accesstoken more than one time Error: Build failed during execution Error: 'Build failed with error code 8' Done building project "Mapbox demo.tmp.proj" -- FAILED. 

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 13 Oct 2015, 01:15 PM
Hello David,

Thank you for reporting this. I was able to reproduce the faulty behavior and indeed, the Android build fails for the MapBox sample app. I logged an issue about this here.

Further, I found a workaround which you can apply in the project until the official fix is released. Here are the steps you will need to take for that:
  1. Open your project in AppBuilder.
  2. Disable the MapBox plugin from your project's Properties > Plugins tab (via the On/Off switch).
  3. Download the latest version of the MapBox plugin as an archive from here.
  4. Import it in your project as a custom Cordova plugin, as shown here.
  5. Open its plugin.xml file and change the following:
    <source-file src="src/android/res/values/mapboxstrings.xml" target-dir="res/values" />
    <config-file target="res/values/mapboxstrings.xml" parent="/*">
      <string name="mapbox_accesstoken">$ACCESS_TOKEN</string>
    </config-file>
    to:
    <!--<source-file src="src/android/res/values/mapboxstrings.xml" target-dir="res/values" />-->
    <config-file target="res/values/strings.xml" parent="/*">
      <string name="mapbox_accesstoken">$ACCESS_TOKEN</string>
    </config-file>
  6. Add the plugin variable as explained.
  7. Try building the project again.

Additionally, for reporting a bug on our side, I have updated your Telerik points accordingly. Thank you once again.

Regards,
Kaloyan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Sample Applications
Asked by
David
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or