Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Augality · Jan 05, 2015 at 09:07 PM · androidplugineclipsejaractivity

Android - Non main activity plugin not working: Class Not Found Exception

Hi everyone

I'm struggling to make my plugin work for Android devices. I'm trying to make an Android plugin that recognizes iBeacons. I use a open source library for that. But when the app is build and run, it won't recognize it. Keep in mind this is NOT the main activity, because I already use a plugin that is set as main in the manifest.

[Attached images & files can be found in this post: http://forum.unity3d.com/threads/android-non-main-activity-plugin-not-working-class-not-found-exception.287818/]

So, how did i make my plugin? I used eclipse and set the project as library so it would make a .jar file when it builds. In the 1st attached image you can see the project setup. Don't mind the closed projects. In the 2th one, you can see I ticked 'Is Library'.

Afterwards, I placed the plugins (my .jar file and the one from proximitykit) in: Assets/Plugins/Android. This can be viewed in the 3th image I attached. In code I tried to start the activity. (.cs file in the .rar attachment)

Last, I added the activity to the AndroidManifest as following:

 <activity android:name="com.kristofvdh.ibeacon.BeaconScanActivity" />

When I build and run the application, the app won't recognize my class created in the plugin. (image 4)

I have read that you could create a build with ant, but ant cannot find my proximitykit packages. (this image is inside the rar, because I can only attach 5 files) So if someone could please help me make this work, because I am a bit stuck. I tried allot of things, searched all over the internet, but cannot make my app work with multiple plugins (activities).

Thanks in advance!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Augality · Jan 14, 2015 at 02:52 PM

Hi everyone

I found the solution to this problem myself. I had to fix my ant build script in order to create the correct .jar file.

Now my app finds the class, but there still is another problem: Exception: JNI: init'd AndroidJavaObject with null ptr!

If you have an idea, you can always post it here: http://forum.unity3d.com/threads/android-non-main-activity-plugin-not-working-class-not-found-exception.287818/#post-1914018

Also, the ant script I created can be found on that page as well. I hope this solution could help others.

More info about ant scripts can be found here: http://ant.apache.org/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Android - Touch input won't work, Invisible activity in front of Unity activity 0 Answers

How to modify a plugin jar file ? 1 Answer

UnityPlayer in an Android MapActivity 3 Answers

Choosing which files to move to Android apk expansion file 0 Answers

Send Variables via Bluetooth Android 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges