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
0
Question by Sergator · Jun 10, 2012 at 07:16 PM · androidcrashloadmemoryintent

Unity Android app crashes when activated a few times with Android's SDK's startActivity(intent).

Hey all.

I have an Android Java application that activates a Unity game by creating and starting an intent. The Unity game has an initial small scene, and a second major one that holds the game itself. The problem is that after a few times that the Java application will start the Unity application, the Unity application will not longer be able to load the major scene, and will then crash.

The process I'm reproducing is as follows:

  1. Restart an Android Galaxy Tab.

  2. Start the native Java application.

  3. Tell the native Java application to run the Unity game by creating an intent with 'PackageManager.getLaunchIntentForPackage("some.package.name")' and running it with 'startActivity(intent)'.

  4. Click a button in the first scene to load the second, major scene.

  5. Kill the game with Unity's Application.Quit();

  6. Wait a minute to make sure Unity had enough time to shut down the game.

  7. repeat steps 3, 4, 5 and 6. After 2-5 times this happens, the Unity application will crash after step 4, when trying to load the second, major scene.

Info about the crash:

  • When the Unity application crashes, the Java application is still running.

  • Once the Unity application crashes once, it will continue to crash if I will try to start it again, even if I will kill the Java application and start again. restarting the tablet lets me run the Unity application again (for a few times till it crashes again).

  • Debug log shows that the application crashes after scripts have been initialized. (But not at a specific point).

  • It seems that some tablets tend to crash after 2-3 cycles, and some only after 5-7 cycles.

Things I've done:

  • Changed textures to RGBA16 format, which was said to be best for Android.

  • Split large images into smaller pieces. This seemed to make the game start properly a few more times.

  • Removed all unneeded assets. The APK is 17MB.

  • Restarted the tablet, removed widgets, and made sure that no applications are running besides the Java application.

  • Since I'm currently using Unity3d 3.4.1, I've tried compiling it on 3.5.2, but this had no effect.

It seems to me like a memory problem, but I suppose that shutting the application with Application.Quit() should be good enough, and there is no way that I know of to remove leftovers if there are any after the Unity application is closed.

I know that what I'm doing here is not too conventional, but I see no reason it shouldn't work. (moreover, it seems to work with other Unity applications, but there is no clear difference between the problematic one and others).

Any help would be appreciated.

Thanks.

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 appearance · Sep 18, 2012 at 11:58 AM

If unity app also created by you, I suggest you follow the way of RolfHarris. You can find his thread here.

Using his technique I successfully created a game in unity3d and made it as a android library and contained it in Android Project.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Unity app crashes after resume to app with intent 1 Answer

Problem with terminating apps on Android 1 Answer

load object into memory 1 Answer

My mobile game crashes once a certain number of textures have been loaded. What can I do about that? 0 Answers

Android Crashes on game load 1 Answer


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