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 mpavlinsky · Feb 21, 2012 at 10:20 PM · androidplugindllimport

Importing multiple functions in an Android plugin.

Hi all,

I am crashing on Android when trying to import two functions from a single Shared Object library that I made (there is no Java code, just C++). Like so:

 [DllImport("loremipsum")]
 private static extern int _Init(IntPtr data, uint dataLength);
 [DllImport("loremipsum")]
 private static extern float _Analyze();

I get the following error from logcat when trying to run this code on device:

 D/dalvikvm( 1785): Trying to load lib /data/data/com.MyCompany.MyProgram/lib/libloremipsum.so 0x40744ac0
 D/dalvikvm( 1785): Added shared lib /data/data/com.MyCompany.MyProgram/lib/libloremipsum.so 0x40744ac0
 D/dalvikvm( 1785): Trying to load lib /data/data/com.MyCompany.MyProgram/lib/libloremipsum.so 0x40744ac0
 D/dalvikvm( 1785): Shared lib '/data/data/com.MyCompany.MyProgram/lib/libloremipsum.so' already loaded in same CL 0x40744ac0
 I/DEBUG   (   80): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
 I/DEBUG   (   80): Build fingerprint: 'acer/picasso_comgen2/picasso:3.1/HMJ37/1309327721:user/release-keys'
 *** CRASH MEMORY DUMP ***

It works fine if I comment out either one of the imports and the associated function prototype. Is there something I'm doing wrong here? I know it's of little significance, but I use something similar to this on my iOS build and it's fine.

Thank you for your help.

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

Answer by thilina098 · Dec 07, 2012 at 02:21 PM

I'm trying to get scaleform to work on Android and I also get the same issue. Can anyone tell me whether this is a Unity issue or a plugin issue?

here is my code.

 [DllImport("gfxunity3d")]
 public static extern void UnityRenderEvent(int id);
     
 [DllImport("gfxunity3d")]
 private static extern void SF_Uninit();

this is the error log I get when I tried running it on my android device

 D/dalvikvm( 4148): Trying to load lib /data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so 0x40871700
 
 D/dalvikvm( 4148): Shared lib '/data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so' already loaded in same CL 0x40871700
 
 D/dalvikvm( 4148): Trying to load lib /data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so 0x40871700
 
 D/dalvikvm( 4148): Shared lib '/data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so' already loaded in same CL 0x40871700
 
 D/dalvikvm( 4148): Trying to load lib /data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so 0x40871700
 
 D/dalvikvm( 4148): Shared lib '/data/data/com.MyCompany.MyProgram/lib/libgfxunity3d.so' already loaded in same CL 0x40871700

Thanks for your help

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Referencing a DLL in C# 0 Answers

Create Java Plugin for Unity 0 Answers

How to place Adv Vertically 1 Answer

How Set Java Plugin on Unity? 0 Answers

Make iOS build using Multiplatform Toolkit?? 2 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