SYMPTOM
Application crashes at startup with the following error message
java.lang.ClassCastException: android.app.Application cannot be cast to com.innoquant.moca.phonegap.MOCApp
SOLUTION
MOCA Plugin works even if the app is not running, in order to achieve this functionality, it requires a class to be declared in your AndroidManifest.xml
application
tag. If the Android platform is already created when you installed MOCA Plugin, this is done automatically by the installation scripts, however it may not work if there is a conflict with other plugin that has the same requirement, or if the android platform is added afterwards.
Open your AndroidManifest.xml
and check the application
tag, you should observe something similar to this example (notice the android:name="com.innoquant.phonegap.MOCApp"
)
Case 1: There is no android:name
tag.
Solution
- Just add the tag as shown in the image above.
Case 2: There are two android:name
tags, or the class declared is from another plugin.
Solution
- In this case the solution is not as straightforward and will require some Java coding in the project.
If there are two plugins with this requirement within your project, you will need to merge these two classes manually. If you have experience coding Java, just go ahead, create a new class with a name of your preference, merge all functionality in a single class (or create a proxy class that instantiates both classes) and declare this new class in the application tag.
In any case, if you are in this particular case, please open a support ticket. We would like to study in detail any more conflicts that may arise with the 3rd party plugin.
Comments
0 comments
Article is closed for comments.