cancel
Showing results for 
Search instead for 
Did you mean: 

Error while Adding dependencies in Existing Android App

dwipal
Explorer
0 Kudos

I have created a project in Android Studio by selecting Empty Activity, Kotlin, and Finish. and then i have added SAP BTP SDK related dependencies to the gradle files, I keep getting issues while running and building app.

error when running the app: Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugCompileClasspath"

I could not find com.sap.cloud.android:fiori:3.3.1.

Required by:

project :app

Search in build.gradle files

build.gradle(Project level)

top-level build file where you can add configuration options common to all sub-projects/modules.<br><br>buildscript {<br>    ext {<br>        kotlin_version = '1.4.31'<br>        compose_version = '1.0.5'<br>        sap_sdk_version = "3.3.1"<br>    }<br>    repositories {<br>        google()<br>        //gradlePluginPortal()<br>        jcenter()<br>        mavenLocal()<br>    }<br>    dependencies {<br>        classpath "com.android.tools.build:gradle:7.1.1"<br>        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"<br>    }<br>}<br>allprojects {<br>    repositories {<br>        google()<br>        jcenter()<br>        mavenLocal()<br>    }<br>}<br>task clean(type: Delete) {<br>    delete rootProject.buildDir<br>}<br>
build.gradle(App level)
plugins {<br>    id 'com.android.application'<br>    id 'org.jetbrains.kotlin.android'<br>}<br><br>android {<br>    namespace 'com.example.fiorilauncherapp'<br>    compileSdk 33<br><br>    defaultConfig {<br>        applicationId "com.example.fiorilauncherapp"<br>        minSdk 24<br>        targetSdk 33<br>        versionCode 1<br>        versionName "1.0"<br>        multiDexEnabled true<br>        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"<br>    }<br><br>    buildTypes {<br>        release {<br>            minifyEnabled false<br>            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'<br>        }<br>    }<br>    compileOptions {<br>        sourceCompatibility JavaVersion.VERSION_1_8<br>        targetCompatibility JavaVersion.VERSION_1_8<br>    }<br>    kotlinOptions {<br>        jvmTarget = '1.8'<br>    }<br>    buildFeatures {<br>        viewBinding true<br>    }<br>}<br><br>dependencies {<br><br>    implementation 'androidx.core:core-ktx:1.7.0'<br>    implementation 'androidx.appcompat:appcompat:1.6.1'<br>    implementation 'com.google.android.material:material:1.9.0'<br>    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'<br>    testImplementation 'junit:junit:4.13.2'<br>    androidTestImplementation 'androidx.test.ext:junit:1.1.5'<br>    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'<br><br>    implementation "com.sap.cloud.android:fiori:$sap_sdk_version"<br>    implementation "com.sap.cloud.android:onboarding:$sap_sdk_version"<br>}
MarkFogle
Advisor
Advisor
0 Kudos

Hi Dwipal,

A few questions :

  1. From looking at your Project level build.gradle, it seems that you're set up to use mavenLocal in your list of repositories. Did you copy the contents of the Fiori SDK into your local maven repository (e.g., "~/.m2/repository" on a Mac)?
  2. Is there a reason that you're using version 3.3.1 of the SDK (the latest version from https://developers.sap.com/trials-downloads.html?search=sdk%20for%20android is 6.0.2)?
  3. Have you tried the "Get Started with SAP BTP SDK for Android" tutorial at https://developers.sap.com/mission.sdk-android-get-started.html to see whether that works?

Regards,

Mark Fogle

SAP BTP SDK for Android

dwipal
Explorer
0 Kudos

Hey Mark,

Thanks for the help. I have updated the version and made some changes in the settings.gradle file, and the error has been resolved. But now the issue is i am following below blog and when i add the launcher screen to layout file app gets crashed and throwing the error

Error inflating class com.sap.cloud.mobile.fiori.onboarding.LaunchScreen

Blog : https://blogs.sap.com/2021/04/27/develop-an-online-odata-mobile-application-using-the-sap-btp-sdk-fo...


MarkFogle
Advisor
Advisor
0 Kudos

Hi Dwipal,

I'm glad that helped. Regarding the new issue, please post a new question (containing as much of the call stack as possible) or make a comment to the blog post to ensure that the correct engineer will see it.

Regards,

Mark

Accepted Solutions (0)

Answers (0)