First adding the Pushwoosh Unity Android plugin to a current project causes a consistent java.lang.ClassNotFoundException when the project loads.

Then creating a brand new Unity Project with 1 scene only including the the Pushwoosh plugin. Attaching the PushNotificationsAndroid MonoBehaviour to the MainCamera continues to receive the following error.

I/Unity   (27005): AndroidJavaException: java.lang.ClassNotFoundException: com.a rellomobile.android.push.PushwooshProxy I/Unity   (27005):   at UnityEngine.AndroidJNISafe.CheckException () [0x00000] i n <filename unknown>:0 I/Unity   (27005):   at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPt r clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unkn own>:0 I/Unity   (27005):   at UnityEngine.AndroidJavaObject._CallStatic[AndroidJavaObj ect] (System.String methodName, System.Object[] args) [0x00000] in <filename unk nown>:0 I/Unity   (27005):   at UnityEngine.AndroidJavaObject.CallStatic[AndroidJavaObje ct] (System.String methodName, System.Object[] args) [0x00000] in <filename unkn own>:0 I/Unity   (27005):   at UnityEngine.AndroidJavaObject.FindClass (System.String n ame) [0x00000] in <filename unknown>:0 I/Unity   (27005):   at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.S tring className) [0x00000] in <filename unknown>:0 I/Unity   (27005):   at UnityEngine.AndroidJavaClass..ctor (System.String classN ame) [0x00000] in <filename unknown>:0 I/Unity   (27005):   at PushNotificationsAndroid.InitPushwoosh () [0x00000] in < filename unkn

Has anyone else seen this problem with the plugin that was updated 7 days ago?

asked 19 Mar '14, 16:25
wussowj's gravatar image

wussowj
2114

Hi, we've experienced the same issue. After some investigation the root of the problem lies in incorrect version of Java compiler that was used to build UnityPushwoosh.jar library. The jar in question was build with Java 7 compiler that is not supported by Android dex tool and as a result of this the classes are silently removed from final dex compiled binaries which cause the ClassNotFoundException above.

You can check the version of compiled class files for yourself. Just unpack UnityPushwoosh.jar like this: unzip UnityPushwoosh.jar and then look at the first 8 bytes of any decompressed *class file. The correct sequence in hexadecimal should be as follows: cafe babe 0000 0032. The last byte is version identifier. If you see this: cafe babe 0000 0033 then the binary was compiled with Java 7 thus resulting in ClassNotFoundException when you try to use it at runtime. The simplest solution would be probably for Push Woosh guys to recompile their binary though looking at the current version in GitHub repository it seems to be already compiled properly.

permanent link
answered 17 Jun '14, 07:31
pmatousek's gravatar image

pmatousek
362

This is great thank you!

(17 Jun '14, 18:42) wussowj wussowj's gravatar image

We didn't get any reports of the same problem after updating the plugin. We've also updated our old Unity project with an updated plugin, and it worked fine.

Could you double check if the UnityPushwoosh.jar is properly placed in the Assets/Plugins/Android folder?

permanent link
answered 20 Mar '14, 09:24
Alex%20Spotar's gravatar image

Alex Spotar
3.6k6

Yes I can confirm that it is in the Assets/Plugins/Android folder. I just created another project from scratch and copied the Plugins folder from the github zip directly into the Assets folder. I edited the AndroidManifest.xml with the proper PACKAGE_NAME and edited the IDs. I'm still getting the ClassNotFoundException. Could this be from using Unity 4.3.4?

(20 Mar '14, 17:25) wussowj wussowj's gravatar image

Hi,

I have the same problem. And an other problem is, i have an other third partys AndroidManifest under Plugins/Android. So I cant place it there. What can i do?

UPDATE: Ive merged the AndroidManifest files and now its working

permanent link
answered 24 Apr '15, 14:43
Gabor's gravatar image

Gabor
11

edited 27 Apr '15, 11:40

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×446
×88

question asked: 19 Mar '14, 16:25

question was seen: 5,733 times

last updated: 27 Apr '15, 11:40