Barcode sample dosent work on Android Studio

Hello,

my System:
Win 10
Android Studio 3.1.4

Installed EMDK 6.9

if i click on build i get a error message
Failed to find target with hash string 'Zebra Technologies Corp:EMDK APIs:26' in: C:\Users\user\AppData\Local\Android\Sdk

and if i insert regarding the info from the web the provided solution:

fileTree(include: ['com.symbol.emdk.jar'], dir: 'C:\\Users\\user\\AppData\\Local\\Android\\Sdk\\add-ons\\addon-symbol_emdk-symbol-26\\libs')

in the file build.gradle

i get this error:

Could not find method provided() for arguments [directory 'C:\Users\user\AppData\Local\Android\Sdk\add-ons\addon-symbol_emdk-symbol-26\libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

anybody a good idea how i can solve that :-(

regards

Anonymous (not verified)
Hi,I have seen this myself

Hi,

I have seen this myself using Android Studio 3.1 but I was not sure if it was just something wrong with my setup.

2 suggestions:

* Use the sdk.dir property - Please see one of my sample projects for an example: WakeLock_WifiLock_Exerciser/build.gradle at master · darryncampbell/WakeLock_WifiLock_Exerciser · GitHub

* Use EMDK from Gradle, as shown in this project: RetailAssistant/build.gradle at master · darryncampbell/RetailAssistant · GitHubThe Gradle distribution is not yet officially supported but if you just want something working this is the easiest way

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello Darryn,thx  but i try

Hello Darryn,

thx  but i try your suggestions but unfortunately i get the error

Could not find method implementation() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

regards

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Please update the gradle to

Please update the gradle to the latest version, the sample project uses 2.3.3, I think the latest is 4.4 but I have a project working with AS 3.1 with gradle 3.1.4.  Please also add google() to the repositories.  I don't have a modified BarcodeSample checked in I'm afraid but it would be similar to RetailAssistant/build.gradle at master · darryncampbell/RetailAssistant · GitHub .  Hope that helps.  The team are working on getting the samples updated for AS 3.1.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello Darryn,i do what you

Hello Darryn,

i do what you recommend here is that what i get:

Could not find method google() for arguments [] on repository container.

regards

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
i check in the sdk tools but

i check in the sdk tools but the google is in the repository

what is wrong?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi, please try with this
Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello Darryn,thx for that

Hello Darryn,

thx for that example but i get this error:

Execution failed for task ':app:mergeDebugResources'.

> Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error:

check logs for details

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello,i create a project like

Hello,

i create a project like the example

Data Capture Profile Feature Tutorial - Zebra Technologies Techdocs

so far good but i get two errors

error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.

error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi, it feels to me like there

Hi, it feels to me like there is something wrong with your Android Studio setup, probably around the versions of dependant libraries being included in your app.  All of those errors relate to resources.  I suggest first getting a standard application to build (without EMDK) and then adding in the EMDK dependencies manually to both gradle, the manifest and your application activity.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello,i create a empty

Hello,

i create a empty project step by step add the code and building works

but if i run then  i get this error:

om.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Failed to find byte code for com/symbol/emdk/EMDKManager$EMDKListener

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


PAUL BETHKE
I see the exact same problem.

I see the exact same problem. Latest Android Studio (3.1.4), Windows 10. EMDK 6.9. Entered example program following tutorial. Initial sync/build looks fine. But when connect WT6000 for load/run, those errors appear. WT6000 Android 5.1, MX 6.3.

Any thoughts?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello Paul,i found the

Hello Paul,

i found the solution: File ->settings disable the checkbox Enable Instant.......

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


PAUL BETHKE
Uwe,Thank you for taking the

Uwe,

Thank you for taking the time to investigate this. I had already disabled "Instant Run".

I tried entering a second sample from the Zebra tutorial website (BasicScanningTutorial). It gave the same errors:

- Java compiler

  - resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.

  - resource android:style/TextAppearance.Material.Widget.Button.Colored not found.

  - failed linking references.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Uwe Stockemer
Hello Paul,for me was helpful

Hello Paul,

for me was helpful that i create first a new project and choose as SDK the EMDK 23

then next the empty Widget

as next i copy and insert the code step by step what they described the example in this new app
and it works hope this helps for you

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


PAUL BETHKE
Uwe,I noticed in your post at

Uwe,

I noticed in your post at Aug 24, 2018 2:46 AM that you ran into those same two error messages. I'm wondering what you changed after that which made those errors go away. I am using the EMDK APIs, Android 23, rev 1216 (API 23). I created both projects from scratch following the tutorials to the letter.

Thank you for your assistance...Paul

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Paul, according to this SO

Hi Paul, according to this SO post that style was added in API 24: java - Error:resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found - Stack Overflow .  Please increase your compile SDK version - take a look at this branch to show an example of doing this with BarcodeSample1 which has higher compile and target sdk versions: samples-emdkforandroid-6_9/BarcodeSample1 at barcodesample1_modified_for_android_studio_3.1 · darryncampbell/samples-emd…

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


PAUL BETHKE
Darryn,Thank you for your

Darryn,

Thank you for your reply. I'm fairly new to Android programming but have built a number of apps before. Trying to link with EMDK is the first time I've encountered such sensitivity to versioning, and there are so many versions that I am quite confused. You mention two - target SDK and compile. But the Android version of the Zebra equipment I'm building for is 5.1 (lollipop), which appears to be labelled API version/level 22. So, perhaps this is the wrong forum, but I am quite at a loss here on how to move forward. So here's what I've tried without success. Do you have any guidance to assist me? You mention changing to "version" 24, but won't that be beyond the capabilities of Lollipop?

from one of the BarcodeSample1 build.gradle files:

compileSdkVersion 'Zebra Technologies Corp:EMDK APIs:23'

buildToolsVersion '25.0.3'

minSdkVersion 19

targetSdkVersion 23

versionCode 8

versionName "6.6.1"

When I change these numbers directly in the build.gradle file, it seems to add new errors. Is there a different place I should be making version changes?

Sorry to be a pest...Paul

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Paul,Does the forked

Hi Paul,

Does the forked repository I shared above work?

As long as your minSdkVersion is 22 or higher it will work on LP devices.  You have 19 & my forked sample is 21 so this should be fine.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments