I'm currently trying to develop a basic barcode scanning app for a Zebra device. It's a TC57. The problem is, imports won't work for me in java. And whenever I try and sync my build.gradle file issues appear. I've included the relevant code below, is there anything I need to fix does anybody know why this is happening?
Thanks!
app/Build.Gradle
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.scanbarcode"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
compileOnly 'com.symbol:emdk:9.1.1'
implementation 'androidx.core:core-ktx:1.7.0'
releaseImplementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
project/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url 'https://maven.fabric.io/public' }
maven { url "https://zebratech.jfrog.io/artifactory/EMDK-Android/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0-alpha09'
}
}
plugins {
id 'com.android.application' version '7.1.3' apply false
id 'com.android.library' version '7.1.3' apply false
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
androidmanifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.scanbarcode">
<uses-permission android:name="com.symbol.emdk.permission.EMDK" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ScanBarcode">
<uses-library android:name="com.symbol.emdk" android:required="false"/>
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Updating the build.grade as follows resolved this error for emdk 9.1.1:
repositories {
google()
//jcenter()
mavenCentral()
maven {
url = "https://zebratech.jfrog.io/artifactory/EMDK-Android/"
}
}
allprojects {
repositories {
google()
//jcenter()
mavenCentral()
//maven {url"https://jitpack.io"}
maven {
url = "https://zebratech.jfrog.io/artifactory/EMDK-Android/"
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With