Whitelisted, still cannot share

ios
android
unity

#1

Hello ,

i cant Compose Tweets to Twitter , when i press share Button ,I can login But nothing else,

Somebody Help please.

using UnityEngine;
using System.Collections;
using Fabric.Twitter;
public class TwitterLogin : MonoBehaviour {
>     public void startLogin()
>     {
>         TwitterSession session = Twitter.Session;
>         if (session == null)
>         {
>             Twitter.LogIn(LoginComplete, LoginFailure);
>         }
>         else
>         {
>             LoginComplete(session);
>         }
>     }

>     public void LoginComplete(TwitterSession session)
>     {
>         Card card = new AppCardBuilder()
>           .GooglePlayId("com.Fabrics.Testfabrics.android")
>           .IPhoneId("123456789")
>           .IPadId("123456789");

>         Twitter.Compose(session, card);
>     }

>     public void LoginFailure(ApiError error)
>     {
>         UnityEngine.Debug.Log("code=" + error.code + " msg=" + error.message);
>     }


> }

#2

Hi @osamadeep,

What platform are you targeting, iOS or Android?


#3

Thanks for reply. I targeting both android and ios


#4

When trying to share, do any errors or warnings end up in the device’s log?


#5

The share box appear. And there is only the app name and install button. Whenot press tweet . All gone and nothing happens. When I check my profile . There is nothing posted


#6

If you are trying this on Android, could you share your logcat? If this is on iOS, could you share your console output from XCode when pressing the Tweet button? We’ll get to the bottom of this!


#7

Hello, i’m experiencing the same issue on android.

here’s the error log from logcat:

error when i invoke compose tweet:
08-04 17:54:31.991 903-1466/? E/Parcel: Class not found when unmarshalling: com.twitter.sdk.android.core.TwitterAuthToken
java.lang.ClassNotFoundException: com.twitter.sdk.android.core.TwitterAuthToken
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at android.os.Parcel.readParcelableCreator(Parcel.java:2275)
at android.os.Parcel.readParcelable(Parcel.java:2239)
at android.os.Parcel.readValue(Parcel.java:2146)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.getString(BaseBundle.java:918)
at android.content.Intent.getStringExtra(Intent.java:5386)
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1780)
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1334)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4802)
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4639)
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:142)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3139)
at android.os.Binder.execTransact(Binder.java:446)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.twitter.sdk.android.core.TwitterAuthToken” on path: DexPathList[[directory “.”],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at android.os.Parcel.readParcelableCreator(Parcel.java:2275)
at android.os.Parcel.readParcelable(Parcel.java:2239)
at android.os.Parcel.readValue(Parcel.java:2146)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.getString(BaseBundle.java:918)
at android.content.Intent.getStringExtra(Intent.java:5386)
at com.android.server.am.ActivityStackSupervisor.startActivityLocked(ActivityStackSupervisor.java:1780)
at com.android.server.am.ActivityStackSupervisor.startActivityMayWait(ActivityStackSupervisor.java:1334)
at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4802)
at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4639)
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:142)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3139)
at android.os.Binder.execTransact(Binder.java:446)
Suppressed: java.lang.ClassNotFoundException: com.twitter.sdk.android.core.TwitterAuthToken
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
… 18 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

error when i post the tweet:
Post Tweet failed
com.twitter.sdk.android.core.TwitterException: Uri file path resolved to null
at com.twitter.sdk.android.tweetcomposer.TweetUploadService.uploadAppCardTweet(TweetUploadService.java:107)
at com.twitter.sdk.android.tweetcomposer.TweetUploadService.onHandleIntent(TweetUploadService.java:79)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)

How i implemented it:
var imageURI = Application.streamingAssetsPath + “/” + imageFileName + “/”;
Card card = new AppCardBuilder ()
.ImageUri (imageURI)
.GooglePlayId (Application.bundleIdentifier);
Twitter.Compose (TwitterSession, card);


#8

Can you share the gradle/maven dependencies file of the project/module? Thanks.


#9

from where i can got that file? sorry iam kinda new on this.


#10

this the code i use, and i add the key and secret in setup correctly.
when i post i got this result : (on real device)

after this there is nothing happens. just back to game normally.
and when i check my twitter account i find nothing.


#11

hello, sorry but there is no gradle/maven dependencies file as the apk is created directly from unity


#12

Thanks for the info. Seems like a build issue related to your IDE/build tool. Try to experiment with build tools/IDE to resolve compile and run time dependencies.


#13

The imageUri of “http://toothcleandergame.com/…” in the code above is an URL, it must be an URI that points to a local media file on the device. See the following for more instructions:

https://docs.fabric.io/unity/twitter/compose-tweets.html


#14

Hi there,
So, how to put a URI that points to a local media file? just a PNG file and then put into unity Asset folder? What it the way to have the URI, would you mind show me a example of the code?
Thank you so much!