Import Gurux DLMS into new Android project

2 posts / 0 new
Last post
delanou
Import Gurux DLMS into new Android project

Hi people, I've added the dependency you point out in other topics (implementation 'com.github.gurux:gurux.dlms.android:-SNAPSHOT') into build.gradle file on a new Empty Activity Project like this:

plugins {
id 'com.android.application'
}

android {
compileSdk 30

defaultConfig {
applicationId "com.example.myapplication"
minSdk 21
targetSdk 30
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_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.github.gurux:gurux.dlms.android:-SNAPSHOT'

testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

The thing is, when I try to sync I get the following message: "Failed to resolve: com.github.gurux:gurux.dlms.android:-SNAPSHOT".

- The version of Android Studio I am using is 2020.3.1 Patch 3 (SDK 21, Android 5.0 +) and the version of Gradle is 7.0.2 -

Am I doing something wrong?

Thanks,
Nico.

Kurumi
Kurumi's picture

Hi Nico,

I believe that repository is missing.
You need to add maven to repositories like this:

allprojects {
repositories {
jcenter()
google()
maven { url 'https://jitpack.io' }
}
}

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi