Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Santosh Patil · Jun 10, 2014 at 05:55 AM · plugintwitter

Android twitter shows error.

Hi, I'm trying to integrate twitter sdk through android plugin but it shows error on start of the app " java.lang.NoClassDefFoundError: twitter4j.conf.ConfigurationBuilder"

Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tarlius · Jun 10, 2014 at 08:29 AM 0
Share

It looks like you might have not included the native plugin/library.

Without more information, you are not very likely to get anything more useful than that. :( Which twitter plugin you are using? twitter4j is a native library, included with many Asset Store plugins, not knowing which one you're having trouble with limits how much help people can give you

avatar image Santosh Patil · Jun 10, 2014 at 08:51 AM 0
Share

@Tarlius i'm using "twitter4j-core-4.0.1.jar" and i've included it in my android project which is later used as a Plugin.

Following is the code snippet used for twitter login

 if (!isTwitterLoggedInAlready()) 
         {
             Log.i(TAG,"Java ---  aaaaaaaaaaaaaaaaaaaa");
             //ConfigurationBuilder bd = new ConfigurationBuilder();
             ConfigurationBuilder bd = new ConfigurationBuilder();
             Log.i(TAG, "-----------     :  "+bd);
             bd.setOAuthConsumer$$anonymous$$ey(TWITTER_CONSU$$anonymous$$ER_$$anonymous$$EY);
             Log.i(TAG,"Java ---  bbbbbbbbbbbbbbbbbbbb");
             bd.setOAuthConsumerSecret(TWITTER_CONSU$$anonymous$$ER_SECRET);
             Log.i(TAG,"Java ---  ccccccccccccccccc");
             Configuration configuration = bd.build();
             Log.i(TAG,"Java ---  ddddddddddddddddd");
 
             TwitterFactory factory = new TwitterFactory(configuration);
             twitter = factory.getInstance();
             Log.i(TAG,"Java ---  eeeeeeeeeeeeeeeee");
             try {
                 requestToken = twitter
                         .getOAuthRequestToken(TWITTER_CALLBAC$$anonymous$$_URL);
                 Log.i(TAG,"Java ---  fffffffff    :  "+requestToken);
                 UnityPlayer.currentActivity.startActivity(new Intent(Intent.ACTION_VIEW, Uri
                         .parse(requestToken.getAuthenticationURL())));
                 Log.i(TAG,"Java ---  gggggggggggggg    :  ");
             } catch (TwitterException e) {
                 e.printStackTrace();
             }
         }

Got the Log of "Java --- aaaaaaaaaaaaaaaaaaaa" after that my app get crashed

avatar image Tarlius · Jun 10, 2014 at 09:01 AM 0
Share

Oh you're calling it all directly from C#? Fair enough...

It looks the the class name is correct, so perhaps theres a problem with how you added it to the project. How did you add it?

Also how are you calling it?

avatar image Santosh Patil · Jun 10, 2014 at 09:05 AM 0
Share

I've no issue with unity to java calling. Don't know why it gives error on app start though i got all promts in java regarding twitter. I've added it in Plugins ->Android folder

unity native calling for Twitter Login

 public static void TwitterLogin() 
     {
         #if UNITY_ANDROID
         AndroidJavaObject playerActivityContext = null;
         if (Application.platform == RuntimePlatform.Android) 
         {
             using (var actClass = new AndroidJavaClass(UNITY_CLASS_NA$$anonymous$$E)) {
                 playerActivityContext = actClass.GetStatic<AndroidJavaObject>(UNITY_ACTIVITY);
             }
             using (var pluginClass = new AndroidJavaClass(JAVA_CLASS_NA$$anonymous$$E))
             {
                 if (pluginClass != null) 
                 {
                     pluginClass.CallStatic("LoginTwitter");
                     
                 }
             }
         }
         #endif
     }
avatar image Tarlius · Jun 10, 2014 at 09:20 AM 0
Share

Ahh so you made a plugin .jar which makes calls in Java to twitter4j. Did you add both the twitter4j .jar and your own .jar to the Assets/Plugins/Android folder?

Or did you export an eclipse project in which you added the calling code or something?

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Twitter Unity Free Plugin 1 Answer

Post Data on Twitter 1 Answer

Social Networking Aggregation Services 0 Answers

android - native twitter connect 0 Answers

How can I access frame data using C# from the NatNetML.dll 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges