cfl
cfl

Reputation: 1049

Android Studio Google endpoints causing UNEXPECTED_TOP_LEVEL_EXCEPTION

I searched for ages to determine why my google endpoints module was causing a UNEXPECTED_.._EXCEPTION when I tried to run the App on a emulator.

Research indicated that a library is being called more than once. But I could find no clear error with regard to this:

My app build.gradle:

compile project(path: ':kk_endpoint', configuration: 'android-endpoints')

compile'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.squareup.picasso:picasso:2.3.2'

And my Google endpoint module build.gradle:

appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.19'
compile 'com.google.appengine:appengine-endpoints:1.9.19'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.19'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:5.1.1'
compile 'com.ganyo:gcm-server:1.0.2'

Clearly nothing is being called twice on face level. What could be the cause of this problem?

Upvotes: 1

Views: 41

Answers (1)

cfl
cfl

Reputation: 1049

After hours of research I found that the problem was coming from the guava lib, and all I needed to do was exclude that lib:

compile (project(path: ':kk_endpoint', configuration: 'android-endpoints')) {
exclude(module: 'guava-jdk5')
}

Please note brackets need to be exactly as above or won't work.

compile project(path: ':kk_endpoint', configuration: 'android-endpoints'){  
exclude(module: 'guava-jdk5')}

Doesn't work. I hope this helps someone save hours

Upvotes: 1

Related Questions