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

Reflection has wrong type data. #4

Open
oscarmore2 opened this issue Nov 23, 2016 · 0 comments
Open

Reflection has wrong type data. #4

oscarmore2 opened this issue Nov 23, 2016 · 0 comments

Comments

@oscarmore2
Copy link

oscarmore2 commented Nov 23, 2016

I encounter this problem and it makes my app CRASH!!!

--------- beginning of crash E/AndroidRuntime(19305): FATAL EXCEPTION: main E/AndroidRuntime(19305): Process: archiive.sofy, PID: 19305 E/AndroidRuntime(19305): java.lang.Error: FATAL EXCEPTION [main] E/AndroidRuntime(19305): Unity version : 5.3.7f1 E/AndroidRuntime(19305): Device model : smartisan YQ601 E/AndroidRuntime(19305): Device fingerprint: SMARTISAN/msm8916_32:5.1.1/LMY47V/1:user/release-keys E/AndroidRuntime(19305): E/AndroidRuntime(19305): Caused by: java.lang.NumberFormatException: Invalid int: "app_id" E/AndroidRuntime(19305): at java.lang.Integer.invalidInt(Integer.java:138) E/AndroidRuntime(19305): at java.lang.Integer.parse(Integer.java:410) E/AndroidRuntime(19305): at java.lang.Integer.parseInt(Integer.java:367) E/AndroidRuntime(19305): at java.lang.Integer.parseInt(Integer.java:334) E/AndroidRuntime(19305): at cn.sharesdk.unity3d.ShareSDKUtils.handleMessage(ShareSDKUtils.java:217) E/AndroidRuntime(19305): at com.mob.tools.utils.UIHandler.handleMessage(UIHandler.java:86) E/AndroidRuntime(19305): at com.mob.tools.utils.UIHandler.access$000(UIHandler.java:13) E/AndroidRuntime(19305): at com.mob.tools.utils.UIHandler$1.handleMessage(UIHandler.java:64) E/AndroidRuntime(19305): at android.os.Handler.dispatchMessage(Handler.java:98) E/AndroidRuntime(19305): at android.os.Looper.loop(Looper.java:135) E/AndroidRuntime(19305): at android.app.ActivityThread.main(ActivityThread.java:5313) E/AndroidRuntime(19305): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(19305): at java.lang.reflect.Method.invoke(Method.java:372) E/AndroidRuntime(19305): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1116) E/AndroidRuntime(19305): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:809) W/ActivityManager( 2730): Force finishing activity 1 archiive.sofy/com.xzimg.rigidfacetracking.RigidFaceTrackingPlugin

I check the code, in Java, the error comes from :

for (Map.Entry<String, Object> entry : devInfo.entrySet())
      {
        String p = ShareSDK.platformIdToName(Integer.parseInt((String)entry.getKey()));
        if (p != null)
        {
          if (DEBUG) {
            System.out.println(p + " ==>>" + new Hashon().fromHashMap((HashMap)entry.getValue()));
          }
          ShareSDK.setPlatformDevInfo(p, (HashMap)entry.getValue());
        }
      }

The Integer.parseInt(Integer) NumberFormatException in the thread causes the whole app crash. Never use parseInt(Integer) but use TryPhase(String, out Integer) instead.

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

1 participant