dialogflow / dialogflow-android-client

Android SDK for Dialogflow
https://dialogflow.com
Apache License 2.0
574 stars 270 forks source link

App crashes on startup with NoClassDefFound error #46

Open zuxie opened 7 years ago

zuxie commented 7 years ago

Hi everyone! I'm currently trying to implement AI.API by following the provided tutorial. When I try to get the app run on the emulator, it crashes upon startup with the following error.

screen shot 2017-06-22 at 3 44 11 pm

I noticed the error has to do with something on line 35 of my code, but I'm simply following the tutorial and not sure what is the issue (token was erased from the code below for confidential purposes).

screen shot 2017-06-22 at 3 46 34 pm

I also tried to use the provided sample app but the same error occurred. I would be really appreciated if someone could provide me with some insights! Thank you so much in advance!

zuxie commented 7 years ago

@Aashit-Sharma I deleted my token to post my code on GitHub.

Aashit-Sharma commented 7 years ago

Lol sorry for being a doofus. Looks like you're calling an undefined class. Have you added all the correct dependencies to the grade build?

zuxie commented 7 years ago

@Aashit-Sharma Yes. I included all the dependencies.

screen shot 2017-06-22 at 9 40 58 pm
folomeev commented 7 years ago

Try to add log4j into dependency list

compile group: 'log4j', name: 'log4j', version: '1.2.17'
zuxie commented 7 years ago

@folomeev it still gives the same error message.

folomeev commented 7 years ago

well, it means that following import should be used instead:

compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.2'
zuxie commented 7 years ago

@folomeev Now the following error occurs:

screen shot 2017-06-22 at 11 39 03 pm screen shot 2017-06-23 at 12 35 33 am

Sorry for all the troubles. I'm new to android programming so I'm not sure how everything works.

Aashit-Sharma commented 7 years ago

What are you trying to make? For a simple example, you shouldn't be having any problems in script manager.

It would be a good idea to restart afresh.

tao1 commented 7 years ago

This issue is duplicate of issue #34 but manifests as a crash on android O