Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting NoSuchMethodError in CrittercismAndroid.SetValue #8

Open
hitorijanai opened this issue Mar 26, 2015 · 5 comments
Open

Getting NoSuchMethodError in CrittercismAndroid.SetValue #8

hitorijanai opened this issue Mar 26, 2015 · 5 comments

Comments

@hitorijanai
Copy link

http://community.crittercism.com/questions/1028/getting-nosuchmethoderror-in-crittercismandroidset.html

I'm getting this error when calling SetValue

@hitorijanai
Copy link
Author

Sorry it seems the fault is mine.

I didn't set Script Execution Order of CrittercismInit to higher level.

@dshirley
Copy link
Contributor

Anything we could fix documentation-wise to help prevent the issue you ran into?
Thanks!

@hitorijanai
Copy link
Author

After reviewing the problem, it turned out it was indeed SetValue that causes the exception. Script Execution Order only matters if I do something with crittercism on Awake(), before crittercism get initialised. Please look into this matter

@hitorijanai hitorijanai reopened this Apr 1, 2015
@hitorijanai
Copy link
Author

@dshirley please help 😫

http://imgur.com/8AsWk5g

AndroidJavaException: java.lang.NoSuchMethodError: no method with name='put' signature='(Ljava/lang/String;Ljava/lang/String;)V' in class Lorg/json/JSONObject;
1   
at UnityEngine.AndroidJNISafe.CheckException(Unknown Source)
2   
at UnityEngine.AndroidJNISafe.GetMethodID(Unknown Source)
3   
at UnityEngine._AndroidJNIHelper.GetMethodID(Unknown Source)
4   
at UnityEngine.AndroidJNIHelper.GetMethodID(Unknown Source)
5   
at UnityEngine._AndroidJNIHelper.GetMethodID(Unknown Source)
6   
at UnityEngine.AndroidJNIHelper.GetMethodID(Unknown Source)
7   
at UnityEngine.AndroidJavaObject._Call(Unknown Source)
8   
at UnityEngine.AndroidJavaObject.Call(Unknown Source)
9   
at CrittercismAndroid.SetValue(Unknown Source)
10  
at CrittercismWrapper.SetValue(Unknown Source)

@dshirley
Copy link
Contributor

dshirley commented Apr 8, 2015

@hitorijanai I don't have spare cycles to fix this right now. It looks like the SetValue function is missing an initialization check:

            if (!isInitialized) {
                    return;
            }

Feel free to add it there. I"m happy to merge a pull request if you've tried it and tested it.

Alternatively you could use Crittercism.setMetadata(String[], String[]). It's a more cumbersome interface but I think it would help you work around the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants