0

I added a library for SQL Server then when i tried to compile and debug my app, throw this error

This is my build.gradle file

build.gradle

I've tried a lot of solutions like:

Add multiDexEnabled true in default config

Change Min and Target SDK Version

Add compile 'com.android.support:multidex:1.0.3'

I don't know if it's the library o maybe i changed something but this make me crazy

All help are welcome

Community
  • 1
  • 1
TccteV
  • 1
  • It looks like you are adding a JDBC library to an Android app. Please read: [JDBC vs Web Service for Android](https://stackoverflow.com/q/15853367/295004) – Morrison Chang May 10 '18 at 18:59
  • 1
    Welcome to Stack Overflow, TccteV! Please consider editing your question to include the relevant parts of the error message and code in your question. Some people have a hard time reading images of text, so including the text itself will help your question get answered. – MMAdams May 10 '18 at 19:10
  • @MorrisonChang Thank you for your answer, i've already did some apps with WS but this time i need to do it with a direct connection to SQL Server, actually the app it was working but when i removed an old library the error ocurres. – TccteV May 10 '18 at 20:10
  • @MMAdams Thank you i'll keep in mind the next time – TccteV May 10 '18 at 20:10

2 Answers2

0

gradle dependency

compile 'org.mariadb.jdbc:mariadb-java-client:1.6.5'

worked for me

OR

I think you have not added multidex application in Application maifest

<?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.myapp">
        <application
                android:name="android.support.multidex.MultiDexApplication" >
            ...
        </application>
    </manifest>

reference link for multidex - https://developer.android.com/studio/build/multidex

only add compile 'com.android.support:multidex:1.0.3' if minSdkVersion 20 or lower

Ajesh
  • 193
  • 8
0

Thanks to everyone, finally i've can resolve my problem, it was the library that i added

I needed library sqljdbc42 but I had the sqljdbc41 instead

Thank you to all

TccteV
  • 1