Buwendra
Buwendra

Reputation: 19

Error importing json simple library to Android Studio

I am getting this error when using an import method I found to Android Studio.

https://github.com/MagicMicky/FreemiumLibrary/wiki/Import-the-library-in-Android-Studio

The import method I am using is in the above link.

This is the error message (Click Here)

This is how it is in the settings.gradle

include ':app',':lib:json-simple-master'

and this is how I edited the build.gradle

dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        compile project(':lib:json-simple-master')
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

This is how I am trying to import the file

import org.json.simple.*;

Upvotes: 0

Views: 1285

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191711

You shouldn't need to follow those instructions

But you edited the wrong build.gradle file.

Update the one like this

android {
   ... 
} 

dependencies {
    ... 
    compile group: 'com.magicmicky.freemiumlibrary', name: 'library', version: '1.1'
} 

If you want a JSON library, android already has org.json... If you want Java object deserialization, use Jackson or Gson.

json-simple doesn't seem necessary in an app

Upvotes: 1

Related Questions