Open ManasviniGanesh opened 7 years ago
It seems like you've accidentally pasted the stack trace twice. Could you share your build.gradle
& the Message
class as well? From what I can from Salut's readme file, they don't seem to advertise the latest version of LoganSquare, so maybe your issue can already be resolved by simply upgrading to 1.3.7
.
Hi, did you find any solution to this ?
I am using the same way as her (Salut), and I am getting the same error, so I think we may have a close build.gradle. For the record, I already tried using 1.3.6 and 1.3.7. If possible, show me what am I doing wrong:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.jotakape.interit.jokenpo"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.github.markrjr:Salut:v0.4.9'
annotationProcessor 'com.github.markrjr:Salut:v0.4.9'
compile 'com.bluelinelabs:logansquare:1.3.7'
annotationProcessor 'com.bluelinelabs:logansquare:1.3.7'
compile 'com.squareup:javapoet:1.2.0'
annotationProcessor 'com.squareup:javapoet:1.2.0'
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
Also, here is my Message class:
@JsonObject
public class Message {
/*
* Annotate a field that you want sent with the @JsonField marker.
*/
@JsonField
public String description;
}
It's odd that your build.gradle
file contains two independent dependencies
blocks. I mean, it shouldn't theoretically be a problem, but can you merge their contents and try again? Also, do you see any generated code in your module's build/generated/source/apt
folder?
I merged them together and updated the previous comment, but the error was still the same.
My build/generated/source/apt
folder only contains an empty "debug" folder.
I actually got it working, it was kind of a dumb mistake, but... I only added theses two following lines in the dependencies and it started working:
compile 'com.bluelinelabs:logansquare-compiler:1.3.7'
annotationProcessor 'com.bluelinelabs:logansquare-compiler:1.3.7'
I was caught by the Gradle trap. Found randomly in the internet that this wasn't enough:
compile 'com.bluelinelabs:logansquare:1.3.7'
annotationProcessor 'com.bluelinelabs:logansquare:1.3.7'
Oh wow, I didn't even spot that one either. Yes, there are two separate artifacts to LoganSquare, logansquare
and logansquare-processor
. Glad you found it out!
## This error has been bothering me since days. LoganSquare's dependencies were installed along with Salut WiFi Library. I am using Salut and LoganSquare.
# My gradle file