Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

uLiveWallpaper - Develop Android Live Wallpapers with Unity!

Discussion in 'Assets and Asset Store' started by ZimM, Dec 20, 2015.

  1. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    That sounds strange. PreferenceActivity is definitely not a requirement, but there seems to be some kind of difference between it and your Activity that leads to this behaviour. Could you probably PM me your project (or at least the Activity source) so I could examine the issue?
     
  2. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Not exactly that simple. Let me tell you the full story, so you'll have better understanding of the subject.
    Each CPU only supports a certain set instructions, sometimes they are called "CPU architecture". There are a lot of different CPU architectures, but Unity only supports x86 and ARMv7 architectures for Android, and those architectures are not compatible. So if build an APK with ARMv7 support only, it won't run on a x86 device. At the time of writing, the dominant majority of Android devices are using a CPU based on ARMv7 architecture, but there is quite a lot of devices using x86. Currently, all Nexus devices are ARMv7. Here is some more information for the reference:
    http://www.androidauthority.com/arm-vs-x86-key-differences-explained-568718/
    As I might guess, the culprit here is the Emulator. You hadn't specified any details about it. Thing is, emulator could have a different architecture than the the device it's emulating. In fact, it is recommended to use x86 architecture for the emulator, because ARM emulator is atrociously slow. But your ARMv7-only APK won't work in an x86 emulator.
    upload_2016-2-2_14-12-14.png

    tl;dr:
    It seems like your emulator is using x86 architecture, which is not compatible with "ARMv7 only" option. Your live wallpaper will still work on an actual ARMv7 device. You might want to create a new emulated virtual device using the ARMv7 image, but that would be very slow.
     
    Last edited: Feb 2, 2016
    jonfinlay likes this.
  3. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    OK Zim, thanks a lot for your comprehensive answers!
     
  4. seven_

    seven_

    Joined:
    Sep 30, 2014
    Posts:
    34
    Could you please elaborate on this or tell me if and where this is (publicly) documented?
    My basic understanding from your reply is that we cannot have a live wallpaper and the "real" app in the same apk? Is this correct?
     
  5. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Unity player can only be started once, it will crash the whole app if you'd try to instantiate it multiple times. So it is not possible to have Unity work as a live wallpaper, and as a "real" Activity simultaneously. It might be possible in theory, but that's quite implausible and would require a ton of reverse engineering work, and a special Activity to handle that, so it's not something that is supported now (and I'm not sure if ever will be).
    I don't know what is considered a "real" app for you, but you can easily have regular Android Activities. The limitation is only if you want to launch Unity in the Activity alongside with live wallpaper.
     
  6. seven_

    seven_

    Joined:
    Sep 30, 2014
    Posts:
    34
    Okay, thanks for clarifying this. The use case is to have the (Unity) wallpaper as an addition to the real (Unity) app. This will lead to crashes, so we should think about having separate apks for the (Unity) wallpaper and the (Unity) app.
     
  7. redred77

    redred77

    Joined:
    May 31, 2013
    Posts:
    23
    @ZimM is right but there's workaround using Android system.

    You can launch two Unity Player by separating process in one app.
    Wallpaper Service can be launched as separate process by some option in AndroidManifest.xml (I don't remember the option right now but I succeeded at that time. I'm sure you can find that easily by Googling)
    But as they run in separate process, preference change listener doesn't work as before. And it will consume more memory.
     
  8. seven_

    seven_

    Joined:
    Sep 30, 2014
    Posts:
    34
    Thanks, this is a good idea. It would be the process attribute to assign another process. It should even be possible to query the process name and load another scene for the wallpaper within Unity.
    I am not sure though what is happening when creating the wallpaper project. As it is most likely not the "normal (Unity)" Android build process, the created project might not be able to be used as ordinary application (i.e. Android activity)? Is there any more information on what is happening when building the wallpaper project than being available in the (public) User Manual? I just would like to know if this approach is working before buying this asset.
     
  9. neodorus

    neodorus

    Joined:
    Mar 4, 2015
    Posts:
    40
    I'm still holding my breath :B.
     
  10. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Update: not relevant anymore, see posts below.

    Hi guys.
    Bad news. Yesterday, right when I was doing some final tests before pushing the update to Asset Store, I've decided to update to Unity 5.3.2. At first glance everything worked fine. I've then looked into the logs and it turned out the "disable sound output to make volume buttons control call volume" feature wasn't working. I've then tried to discover the reason, and... it seems like the old method of finding a reference of FMODAudioDevice and the calling a stop() method on it isn't going to work anymore, since there is no reference to FMODAudioDevice anywhere in the code. In fact, it seems like the sound system is now completely controlled from native code, and what this means is it's impossible to control the sound system from outside.
    I've stayed all night trying to find some solution, but no luck. This is also the reason why update is not live yet. I'm going to give it a few more hours, and, if I won't find any way to disable the sound system in 5.3.x, I'll release the update as-is and try to fix this issue in another update. Note that everything works fine in 5.0.x-5.2.x, only 5.3.x is problematic.
     
    Last edited: Feb 7, 2016
    neodorus likes this.
  11. neodorus

    neodorus

    Joined:
    Mar 4, 2015
    Posts:
    40
    This would be awesome (at least we'd be able to use it).
     
  12. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    This is almost comical. Turns out, there was no need for ugly hacks. Unity allows to disable the sound system on its own.
    Just go to Edit → Project Settings → Audio and check "Disable Unity Audio":

    I've tested and it works great. I'm feeling somewhat stupid now...

    With this sorted out, I am submitting the update, should be live any minute now.
     
    Last edited: Feb 7, 2016
    DRIVER1ksa and neodorus like this.
  13. redred77

    redred77

    Joined:
    May 31, 2013
    Posts:
    23

    WOW!!!!!
    I too had hard times trying to know how to disable audio system and stuck.

    This is great solution. Thanks.
     
  14. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    uLiveWallpaper 1.1.0 is now live on Asset Store! This release brings a ton of new stuff, fixes, and overall improvements. I hope it'll be worth the long wait.

    Change log:


    New features
    • Full PlayMaker integration.
    • Wallpaper scrolling data emulation for launchers that do not support scrolling (like TouchWiz). Also automatically works when wallpaper is in preview mode.
    • Added PreferencesActivityTriggered event, called when “Settings…” button is tapped in the wallpaper preview screen.
    • Added CustomEventReceived event, can be used to receive custom events from Java side.
    • Added option to use an invisible self-closing settings Activity. Used in conjunction with the new PreferencesActivityTriggered event to allow handling the settings on your own (by showing/hiding the settings UI in Unity).
    • Added Ctrl+Shift+U hotkey for Update Project function.
    • Added Preferences.DeleteAll, Preferences.DeleteKey, and Preferences.HasKey methods.
    • Throw InvalidPreferenceTypeException when trying to get a preference using an invalid data (i.e. using Preference.GetString on a boolean preference).
    • Added CheckboxPreferenceObjectEnabled script that enables or disables GameObjects and components based on checkbox preference value.
    • Added missing XML documentation for uLiveWallpaper assemblies.
    Improvements and fixes
    • Fixed critical multi-threading issue – events were called outside of main thread, which lead to not being able use Unity API and occasional random crashes.
    • Improved demo scenes and example scripts.
    • Fixed an issue in TapToOpenSettings script that often led to settings activity opening unintendedly.
    • LiveWallpaper.GetIsPreview() and LiveWallpaper.GetIsVisible() are now properties LiveWallpaper.IsPreview and LiveWallpaper.IsVisible.
    • Android TV support is now automatically disabled when creating projects.
    • Fixed temporary staging project directory not being fully deleted when doing Create Project.
    • Other minor fixes.
    • Minor UI improvements.
     
  15. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    It is actually mostly "normal" Unity build process. What exactly happens during the project creation process
    1) Android Project is built with Unity using "Export as Google Android Project" feature.
    2) uLiveWallpaper post-processes the project by injecting the wallpaper service code and related stuff into the project.
    3) By default, uLiveWallpaper will also delete Unity's "normal" Activities.
    So really, nothing too complex is going on. The resulting project is a regular Android project, and you can use regular Activities in it, unless these activities do not host a Unity player in addition to live wallpaper. Separating the Activity and live wallpaper Service into two different processes might work in theory, but this scenario is currently not supported by uLiveWallpaper. You'll have to modify uLiveWallpaper code in order to correctly handle everything. And, honestly, I can't guarantee if it'll work anyway.
     
  16. Mario_Basha

    Mario_Basha

    Joined:
    Jan 18, 2016
    Posts:
    14
    If used with unity personal edition, unity logo will appear each time the wallpaper run on the device ?!!
     
  17. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Yes, the same as with a regular Android application. uLiveWallpaper itself has nothing to do with it.
     
  18. neodorus

    neodorus

    Joined:
    Mar 4, 2015
    Posts:
    40
    I'm getting some errors when trying to export an empty settings panel. Any ideas?

    11 upload_2016-2-7_16-36-53.png
     
  19. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Huh. Thanks for reporting, I'll look into this, should be an easy fix.
    Meanwhile, it's also easy to workaround. Just delete this line in LiveWallpaperService.java:
    Code (CSharp):
    1. PreferenceManager.setDefaultValues(getApplicationContext(), R.xml.preferences, false);
    and add this line into the import section at the top of SettingsActivity.java
    Code (CSharp):
    1. import android.app.Activity;
    and it all should work.
     
    neodorus likes this.
  20. DRIVER1ksa

    DRIVER1ksa

    Joined:
    May 29, 2015
    Posts:
    27
    Hello

    i remake the hole example For learning"VirtualBox scene", but the only thing not working is settings

    im using unity5.1.2 and Android Studio





    and itry "VirtualBox_Android_Studio.zip and build apk was same error

    Any ideas?
     
  21. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Something crashes, but I can't really tell without logs. Please attach the logcat logs (from Android Monitor tab in Android Studio) from the time of crash, so I can investigate the issue. Also, when exactly does the error happens?
     
  22. DRIVER1ksa

    DRIVER1ksa

    Joined:
    May 29, 2015
    Posts:
    27
    Code (CSharp):
    1. 02-10 02:26:52.466    1940-1940/? D/dalvikvm﹕ Late-enabling CheckJNI
    2. 02-10 02:26:52.606    1940-1946/? E/jdwp﹕ Failed sending reply to debugger: Broken pipe
    3. 02-10 02:26:52.606    1940-1946/? D/dalvikvm﹕ Debugger has detached; object registry had 1 entries
    4. 02-10 02:26:52.676    1940-1940/? D/AbsListView﹕ Get MotionRecognitionManager
    5. 02-10 02:26:52.736    1940-1940/? D/AbsListView﹕ Get MotionRecognitionManager
    6. 02-10 02:26:52.736    1940-1940/? W/Resources﹕ Converting to string: TypedValue{t=0x10/d=0x3 a=-1}
    7. 02-10 02:26:52.826    1940-1940/? W/Resources﹕ Converting to string: TypedValue{t=0x10/d=0x1e a=-1}
    8. 02-10 02:26:52.826    1940-1940/? W/Resources﹕ Converting to string: TypedValue{t=0x10/d=0xf a=-1}
    9. 02-10 02:26:52.826    1940-1940/? W/Resources﹕ Converting to string: TypedValue{t=0x10/d=0xf a=-1}
    10. 02-10 02:26:52.826    1940-1940/? W/Resources﹕ Converting to string: TypedValue{t=0x10/d=0xf a=-1}
    11. 02-10 02:26:52.826    1940-1940/? W/Resources﹕ Converting to string: TypedValue{t=0x10/d=0xf a=-1}
    12. 02-10 02:26:52.826    1940-1940/? W/Resources﹕ Converting to string: TypedValue{t=0x10/d=0xf a=-1}
    13. 02-10 02:26:52.826    1940-1940/? W/Resources﹕ Converting to string: TypedValue{t=0x10/d=0xf a=-1}
    14. 02-10 02:26:52.826    1940-1940/? W/Resources﹕ Converting to string: TypedValue{t=0x10/d=0x1e a=-1}
    15. 02-10 02:26:52.826    1940-1940/? W/Resources﹕ Converting to string: TypedValue{t=0x10/d=0x1e a=-1}
    16. 02-10 02:26:52.836    1940-1940/? D/AbsListView﹕ onVisibilityChanged() is called, visibility : 4
    17. 02-10 02:26:52.836    1940-1940/? D/AbsListView﹕ unregisterIRListener() is called
    18. 02-10 02:26:52.856    1940-1940/? D/AbsListView﹕ onVisibilityChanged() is called, visibility : 0
    19. 02-10 02:26:52.856    1940-1940/? D/AbsListView﹕ unregisterIRListener() is called
    20. 02-10 02:26:52.896    1940-1940/? D/libEGL﹕ loaded /vendor/lib/egl/libGLES_vc4.so
    21. 02-10 02:26:52.896    1940-1940/? D/﹕ GPU monitor inactive - could not find libgpumonitor.so [Symbol not found: ] or not enabled (debug.egl.hw.gpumonitor = 0)
    22. 02-10 02:26:52.906    1940-1940/? W/khrn_client﹕ init_window num_buffers 3 min undequeued buffers 1
    23. 02-10 02:26:52.906    1940-1940/? W/khrn_client﹕ init_window window 0x4f6f8d88, 480x800 hintTransform 0x0 do_pre 1
    24. 02-10 02:26:52.916    1940-1940/? D/OpenGLRenderer﹕ Enabling debug mode 0
    25. 02-10 02:26:52.996    1940-1940/? D/AbsListView﹕ unregisterIRListener() is called
    26. 02-10 02:26:53.006    1940-1940/? D/AbsListView﹕ unregisterIRListener() is called
    27. 02-10 02:26:53.206    1940-1940/? D/AbsListView﹕ unregisterIRListener() is called
    28. 02-10 02:26:53.336    1940-1940/? D/AbsListView﹕ unregisterIRListener() is called
    29. 02-10 02:27:08.651    1940-1940/com.lostpolygon.ulivewallpaper.virtualbox D/AbsListView﹕ Get MotionRecognitionManager
    30. 02-10 02:27:08.651    1940-1940/com.lostpolygon.ulivewallpaper.virtualbox D/AndroidRuntime﹕ Shutting down VM
    31. 02-10 02:27:08.651    1940-1940/com.lostpolygon.ulivewallpaper.virtualbox W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x40f4a930)
    32. 02-10 02:27:08.671    1940-1940/com.lostpolygon.ulivewallpaper.virtualbox E/AndroidRuntime﹕ FATAL EXCEPTION: main
    33.     java.lang.NullPointerException
    34.             at com.android.internal.app.AlertController.setupContent(AlertController.java:521)
    35.             at com.android.internal.app.AlertController.setupView(AlertController.java:414)
    36.             at com.android.internal.app.AlertController.installContent(AlertController.java:260)
    37.             at android.app.AlertDialog.onCreate(AlertDialog.java:337)
    38.             at android.app.Dialog.dispatchOnCreate(Dialog.java:357)
    39.             at android.app.Dialog.show(Dialog.java:261)
    40.             at android.preference.DialogPreference.showDialog(DialogPreference.java:320)
    41.             at android.preference.DialogPreference.onClick(DialogPreference.java:278)
    42.             at android.preference.Preference.performClick(Preference.java:957)
    43.             at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:229)
    44.             at android.widget.AdapterView.performItemClick(AdapterView.java:301)
    45.             at android.widget.AbsListView.performItemClick(AbsListView.java:1490)
    46.             at android.widget.AbsListView$PerformClick.run(AbsListView.java:3275)
    47.             at android.widget.AbsListView$1.run(AbsListView.java:4518)
    48.             at android.os.Handler.handleCallback(Handler.java:725)
    49.             at android.os.Handler.dispatchMessage(Handler.java:92)
    50.             at android.os.Looper.loop(Looper.java:137)
    51.             at android.app.ActivityThread.main(ActivityThread.java:5283)
    52.             at java.lang.reflect.Method.invokeNative(Native Method)
    53.             at java.lang.reflect.Method.invoke(Method.java:511)
    54.             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
    55.             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
    56.             at dalvik.system.NativeStart.main(Native Method)
    57.  


    when click any option in setting menu
     
    Last edited: Feb 10, 2016
  23. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    What version of Android do you use? Judging from the screenshots, it's some kind of modified Android 2.3. Is it correct? It is not possible for me to support all kinds of possible modifications. This is definitely not uLiveWallpaper issue itself, since I've tried the demo APK in a Android 2.3 emulator and found no issues. In fact, the stack trace you've posted never even goes into uLiveWallpaper code - the crash happens somewhere deep in Android OS itself. Also, no one else has reported anything similar. I'd assume it is something weird with your Android, and suggest using a non-modified OS.
     
  24. DRIVER1ksa

    DRIVER1ksa

    Joined:
    May 29, 2015
    Posts:
    27
    maybe i did something wrong in Android Studio. was i used for first time"I was working on Eclipse"

    Android Demo APK is work fine for me
    but "VirtualBox_Android_Studio.zip and build apk and test on android 4..2.2 was get error in settings menu
    I suggest you to add some Youtube tutorials in the future

    Thanks for your time
     
  25. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    The fact that the demo APK from the link works fine for you, but the builds that you build do not, suggests there are some issues with the build process itself. I don't think you've did something wrong in the Android Studio, since otherwise you won't be able to build the project at all. I'd suggest you try uninstalling and reinstalling the Android SDK. Other than that, it's hard to guess what's going on, but it's almost certainly something in the setup.
     
  26. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hi, I've just tried out the new version, and right at the very end of the Create Project process I get the following error message:

    UnauthorizedAccessException: Access to the path is denied.
    System.IO.Directory.Move (System.String sourceDirName, System.String destDirName) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/Directory.cs:403)
    LostPolygon.uLiveWallpaper.Editor.Internal.IOUtilities+<MoveDirectoryFiles>c__AnonStorey7.<>m__11 () (at G:/PROGRAMMING/Repos/BitBucket/uLiveWallpaper/UnityProject/Assets/uLiveWallpaper/Source/Internals/Editor/Utilities/IOUtilities.cs:26)
    LostPolygon.uLiveWallpaper.Editor.Internal.IOUtilities.AttemptPotentiallyFailingOperation (System.Action action, Int32 maxAttempts, Int32 delayBetweenAttempts) (at G:/PROGRAMMING/Repos/BitBucket/uLiveWallpaper/UnityProject/Assets/uLiveWallpaper/Source/Internals/Editor/Utilities/IOUtilities.cs:253)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:187)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:180)
    UnityEditor.HostView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:76)


    I did exactly the same as I did before, any ideas what the problem could be?

    The error always happens on the Post Processing Files part, then it says folder not empty, and the above error message.
    Thanks
     
    Last edited: Feb 11, 2016
  27. VectorNector

    VectorNector

    Joined:
    May 22, 2013
    Posts:
    60
    So far I've been testing it like crazy and I am in absolute awe in what is capable now. I only want to publish the absolute best LWP so I'm going to spend a bit of time building something worthy of your home screen. As soon as I get a demo version I will post it here. I can't wait to see what others produced as well.
     
  28. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Good news, I tried again and the issue I had yesterday seems to have disappeared, and now I was able to export the project into Android Studio. However, I did note one change, when I installed it onto my phone it asked for Full Internet Access permission, which I'm sure it didn't ask for before the update. How can this be deactivated? Thanks
     
  29. DRIVER1ksa

    DRIVER1ksa

    Joined:
    May 29, 2015
    Posts:
    27
  30. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    It's seems like something was blocking the Android Studio project directory. This can happen for a ton of reasons, but usually just closing all applications that could possibly use the project directory, and then trying again works (or, in worst case, a reboot). Though I agree, the error message is not very informative... I'll work on that.
    As for the Full Internet Access permission - there were no changes in uLiveWallpaper that could introduce that. Probably you've also updated your Unity version? Recent versions of Unity now always add the Internet permission, as it is used by Unity for device analytics... I don't think there is a way to make Unity not do that. However, you can just remove the permission in your AndroidManifest.xml in your Android Studio project, and it'll be just fine.
     
    Last edited: Feb 14, 2016
    jonfinlay likes this.
  31. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Yeah, I am also waiting patiently for the awesome stuff you guys are definitely going to create with uLiveWallpaper :) I believe it is possible to create absolutely stunning live wallpapers with Unity.
    Sure, please check your email.
     
    VectorNector likes this.
  32. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Yeah I updated Unity a few days ago, must have been caused by that. Cheers.
     
  33. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    23
    Hi Zim,

    I am all updated in regards to Unity and your stuff. I found the Audio option you mentioned earlier about disabling the Unity audio (Edit > Project Settings > Audio).

    I updated my project with the disable Unity audio checked, but when I try to load the wallpaper, I get this error in LogCat:

    E/Unity: Error: Cannot create FMOD::Sound instance for resource sharedassets0.resource, (An invalid object handle was used. )

    E/Unity: Function SoundHandle::Instance::~Instance() may only be called from main thread!

    Any ideas on what's causing this?

    Edit Update: No solution yet, I just wanted to add that I'm upgrading an older wallpaper I have on the market already. It did include sounds on touch, but I had an option that user can toggle to turn off sound (uni2LWP had a working method of disabling all audio so the user can adjust their phone volume instead of the media volume). I probably won't update this app until sound is working as it used to but.. I'd still like it to work without sound.. just to test. Thanks!
     
    Last edited: Feb 15, 2016
  34. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    I've reproduced the issue by adding an AudioSource component to the scene and deploying it to the device. I've got the same error message, and the loading process hanged after that. This is definitely a Unity bug, since uLiveWallpaper has nothing to do with sounds. You should file a bug report to Unity on this (I will send the bug report as well). Basically, you can't allow Unity to attempt loading a sound when "Disable audio" option is checked. Try removing all sounds sources in your project and try if it works then.
    I don't think there is a way to turn Unity sound system on and off in runtime, though. What you can do is use some other way to play sounds, completely avoiding the Unity sound system. For example, you might use Android API for that, but, obviously. you'd have to do some Java programming for that.

    P.S. Well, there is a way to turn Unity sound system on and off in runtime using a method similar to what was implemented in Uni2Lwp, but it only works in Unity versions before 5.3. I really don't think it'd make sense to add a single feature that would only work for outdated Unity versions...
     
    Last edited: Feb 17, 2016
  35. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    23

    Agreed. I'll file a bug report as well. Thanks for looking into it. I never considered playing audio on the Android side, which is totally possible! Thanks for the idea. And again, great work Zim!
     
  36. hellaandrew

    hellaandrew

    Joined:
    Mar 31, 2010
    Posts:
    23
    Worked like a charm! Removed the audio file and any references to it in the code, and also the audio listener component off of the camera, and now the wallpaper is running great!
     
    ZimM and resheez like this.
  37. VectorNector

    VectorNector

    Joined:
    May 22, 2013
    Posts:
    60
    I don't know what you did but I am so happy that you made it possible for us to make LWP again. I had to stop development on my Unity based LWP because of the deprecated asset that I used to build it. It was heart breaking to say the least.

    What was the hardest hurdle did you overcome? Did Unity started to allow LWP development on Android? I am curious by all this beautiful magic.
     
  38. tinatsen

    tinatsen

    Joined:
    Feb 19, 2016
    Posts:
    2
    Hello ZimM! I want to buy uLiveWallpaper Pro, it definitely looks like a must-have. But when I'm downloading the .apk file from the unity asset store - https://www.assetstore.unity3d.com/en/#!/content/52477, there is a problem. I can not run the apk file then on my two tablets - Galaxy Tab S2, Android version 5.0.2 and Android version 4.0.4 and my mobile phone - Galaxy S4, Android version 4.4.2. There is no OPEN tab enabled, only DONE tab has been enabled. There is no icon on my screen too. And I allow this apk to be installed. Here are some screenshots:













    Any ideas what is going on? Thanks in advance ZimM!
     
  39. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    You need to go to your wallpaper settings, choose Live Wallpaper, and enable it from there.
     
  40. thedred112

    thedred112

    Joined:
    Jul 15, 2013
    Posts:
    2
    Hello ,ZimM. Do you know why LiveWallpaperUnityFacade.getInstance() != null allways true?
    For example: on my phone default system live walpaper, i enter wallpaper settings, click unity, and faster then lighning go to settings and send to unity
    Code (CSharp):
    1.  
    2. if (LiveWallpaperUnityFacade.getInstance() != null) {
    3. UnityPlayer.UnitySendMessage("Main Camera", "ChangeScene", newValue.toString());
    4. }
    5.  
    after go back and 50% see black window or all fine and new scene selected, no errors in log. I hope could explain my problem.

    Try to debug:
    Code (CSharp):
    1.         if (LiveWallpaperUnityFacade.getInstance() == null) {
    2.            Toast.makeText(SettingsActivity.this, "Wait please", Toast.LENGTH_LONG).show();
    3.          }else
    4.         {
    5.             Toast.makeText(SettingsActivity.this, "Ready!", Toast.LENGTH_LONG).show();
    6.         }
    always print "Ready!"
    its all for old version. On new version when i click graphics quality or frames per second programm crash
    log:
    http://pastebin.com/aWVXP7Pr


    its log from your test app same error
    http://pastebin.com/7i3emZqN
     
    Last edited: Feb 20, 2016
  41. Andrew_Novak

    Andrew_Novak

    Joined:
    Feb 20, 2016
    Posts:
    2
  42. resheez

    resheez

    Joined:
    Mar 22, 2013
    Posts:
    66
    I don't think thats ZimM's job.
    Thats up to your creativity.
     
    VectorNector likes this.
  43. Andrew_Novak

    Andrew_Novak

    Joined:
    Feb 20, 2016
    Posts:
    2
    I solved problem with him. Thanks
     
  44. ScreamingSnail

    ScreamingSnail

    Joined:
    Oct 4, 2014
    Posts:
    4
    Hi ZimM,

    I've published a new live wallpaper into my beta channel, it works just fine on my Nexus devices (Nexus 5,Nexus7,Galaxy Nexus) but when I tested on my wife's HTC One M7 (unmodified) it crashes before it loads with a signal 11 error. Any thoughts on why this is happening? Anyone else reporting this type of error?

    Thanks.
     
  45. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    There's very little magic involved, mostly just clever workarounds :) Unity never "allowed" LWP development, but neither they forbid that. They just don't care about LWP at all, so it's up for developers to make it work somehow... The main problem was creating the UnityPlayer instance, since its constructor crashes if called from anything other Activity, but I got around it with very little side effects.
    LiveWallpaperUnityFacade.getInstance() returns true when Unity Player is created. It is only created once when live wallpaper is first seen, so after LiveWallpaperUnityFacade.getInstance() starts returning true, it won't return false ever again until the live wallpaper is killed. Going to wallpaper Settings won't kill it. It's hard to say why sometimes after fast switching you see a black window. Can you investigate whether the scene is loaded? I couldn't reproduce the issue on my device.
    The crash after clicking the menu item is very strange as well. There were basically no changes to the settings Activity code. Could you try to remove this block of code from SettingsActivity.java and try again?
    Code (CSharp):
    1.  
    2.         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
    3.             setTheme(android.R.style.Theme_DeviceDefault_Settings);
    4.         } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    5.             setTheme(android.R.style.Theme_Holo);
    6.         } else {
    7.             setTheme(android.R.style.Theme);
    8.         }
     
  46. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    No one else has reported an immediate crash before. Could you please send me the logcat log? It's hard to say something with this little information.
     
  47. ScreamingSnail

    ScreamingSnail

    Joined:
    Oct 4, 2014
    Posts:
    4
    Here's the stack trace from the crash report:

    Build fingerprint: 'htc/tmous/m7:4.4.3/KTU84L/365514.10:user/release-keys'
    Revision: '3'
    pid: 16694, tid: 16710, name: UnityMain >>> com.screamingsnail.ancientstreet <<<
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
    Abort message: 'invalid address or address of corrupt block 0x81d1ab70 passed to dlfree'
    r0 deadbaad r1 400bbeaa r2 7a53c25c r3 400c0ef9
    r4 81d1ab70 r5 400cb38c r6 7b77f008 r7 400cb188
    r8 81d1ab78 r9 00000000 sl 400e113c fp 0000000c
    ip 00000001 sp 7a53c268 lr 4008c185 pc 4008c186 cpsr 600a0030
    d0 2064696c61766e69 d1 2073736572646461
    d2 657264646120726f d3 6f6320666f207373
    d4 0009228000000000 d5 0000000010001000
    d6 0000000000000000 d7 0000000000000000
    d8 0000000000000000 d9 0000000000000000
    d10 0000000000000000 d11 0000000000000000
    d12 0000000000000000 d13 0000000000000000
    d14 0000000000000000 d15 0000000000000000
    d16 0000000000e01010 d17 000000000001228a
    d18 0000000000000000 d19 0000000000000000
    d20 0000000000000000 d21 0000000000000000
    d22 ffc0001000002068 d23 0000000b000021ea
    d24 0000000000000000 d25 0000000000000000
    d26 0000000000000000 d27 0000000000000000
    d28 0000000000000000 d29 00000000bca237c3
    d30 bf800000bf800000 d31 3f800000bf7aee42
    scr 6800001a

    backtrace:
    #00 pc 00012186 /system/lib/libc.so (dlfree+1409)
    #01 pc 0000dd9b /system/lib/libc.so (free+10)
    #02 pc 00092a9d /system/vendor/lib/libsc-a3xx.so
    #03 pc 00108df1 /system/vendor/lib/libsc-a3xx.so
    #04 pc 000d7873 /system/vendor/lib/libsc-a3xx.so
    #05 pc 000e8815 /system/vendor/lib/libsc-a3xx.so
    #06 pc 000e9a5f /system/vendor/lib/libsc-a3xx.so
    #07 pc 0004855d /system/vendor/lib/egl/libGLESv2_adreno.so (gl2_context_delete+100)
    #08 pc 00019d30 /system/vendor/lib/egl/libEGL_adreno.so (eglDestroyClientApiContext+60)
    #09 pc 00019db4 /system/vendor/lib/egl/libEGL_adreno.so (eglFreeContext+72)
    #10 pc 0001a588 /system/vendor/lib/egl/libEGL_adreno.so (eglContextReleaseRef+280)
    #11 pc 000106d0 /system/vendor/lib/egl/libEGL_adreno.so (qeglDrvAPI_eglDestroyContext+340)
    #12 pc 00006b70 /system/vendor/lib/egl/libEGL_adreno.so (eglDestroyContext+16)
    #13 pc 0000ffc1 /system/lib/libEGL.so (eglDestroyContext+64)
    #14 pc 004bdea8 /data/app-lib/com.screamingsnail.ancientstreet-1/libunity.so
    #15 pc 004bea84 /data/app-lib/com.screamingsnail.ancientstreet-1/libunity.so
    #16 pc 004bdf28 /data/app-lib/com.screamingsnail.ancientstreet-1/libunity.so
    #17 pc 000298dd /system/lib/libc.so (__cxa_finalize+156)
    #18 pc 00029ad5 /system/lib/libc.so (exit+6)
    #19 pc 00112ccd /system/vendor/lib/libsc-a3xx.so
    #20 pc 002fab41 /system/vendor/lib/libsc-a3xx.so
    #21 pc 002f6e23 /system/vendor/lib/libsc-a3xx.so
    #22 pc 002fa507 /system/vendor/lib/libsc-a3xx.so
    #23 pc 0032c75b /system/vendor/lib/libsc-a3xx.so
    #24 pc 0032d5ef /system/vendor/lib/libsc-a3xx.so
    #25 pc 0032ecf5 /system/vendor/lib/libsc-a3xx.so
    #26 pc 0032c461 /system/vendor/lib/libsc-a3xx.so
    #27 pc 0014bdbb /system/vendor/lib/libsc-a3xx.so
    #28 pc 0014be89 /system/vendor/lib/libsc-a3xx.so
    #29 pc 002cb235 /system/vendor/lib/libsc-a3xx.so
    #30 pc 000b0807 /system/vendor/lib/libsc-a3xx.so
    #31 pc 00091e5b /system/vendor/lib/libsc-a3xx.so

    code around pc:
    4008c164 44784848 1e4a6a01 b95a6202 fb20f7fd
    4008c174 4845e008 4a454621 447a4478 f9f2f001
    4008c184 6004481a 44784842 21bcf8d0 d52a0792
    4008c194 70e0f500 e8bdb005 f02d43f0 483db9e9
    4008c1a4 46239300 f7fd4478 2800fa03 ad9af47f
    4008c1b4 4839e63d e5b24478 429f688f ada2f43f
    4008c1c4 9000e5a4 4835462b f7fd4478 2800f9f1
    4008c1d4 af22f43f 4832e586 e5a04478 42ab688b
    4008c1e4 ae94f43f b005e696 83f0e8bd deadbaad
    4008c1f4 0003f56a 0003f55c 0003f4c4 00035209
    4008c204 0003f46e 000351d5 00030026 00030119
    4008c214 0003f40c 00035173 0003f3f0 0003f3dc
    4008c224 00030069 000350fd 00030047 000350db
    4008c234 0003f33a 0003f31e 0003f2bc 0003f2a6
    4008c244 0003f268 00034fd1 0003f220 0002fe1a
    4008c254 0002ff0d 00034f6b 0003f1ea 0003f1d8

    code around lr:
    4008c164 44784848 1e4a6a01 b95a6202 fb20f7fd
    4008c174 4845e008 4a454621 447a4478 f9f2f001
    4008c184 6004481a 44784842 21bcf8d0 d52a0792
    4008c194 70e0f500 e8bdb005 f02d43f0 483db9e9
    4008c1a4 46239300 f7fd4478 2800fa03 ad9af47f
    4008c1b4 4839e63d e5b24478 429f688f ada2f43f
    4008c1c4 9000e5a4 4835462b f7fd4478 2800f9f1
    4008c1d4 af22f43f 4832e586 e5a04478 42ab688b
    4008c1e4 ae94f43f b005e696 83f0e8bd deadbaad
    4008c1f4 0003f56a 0003f55c 0003f4c4 00035209
    4008c204 0003f46e 000351d5 00030026 00030119
    4008c214 0003f40c 00035173 0003f3f0 0003f3dc
    4008c224 00030069 000350fd 00030047 000350db
    4008c234 0003f33a 0003f31e 0003f2bc 0003f2a6
    4008c244 0003f268 00034fd1 0003f220 0002fe1a
    4008c254 0002ff0d 00034f6b 0003f1ea 0003f1d8
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
    --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
     
  48. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    945
    Please use the Spoiler tag to hide big blocks of text. Thanks.
    Could you also send the whole log from the moment of application startup? The crash stack alone is not very helpful. But from what I can understand from it, crash happens somewhere deep in the GPU driver library. Are you able to build and run regular Android applications from Unity on your device?
     
  49. ScreamingSnail

    ScreamingSnail

    Joined:
    Oct 4, 2014
    Posts:
    4
    I'll get that info to you later today when I have access to the device. Thanks.
     
  50. tinatsen

    tinatsen

    Joined:
    Feb 19, 2016
    Posts:
    2
    Hi ZimM. :) I bought the uLiveWallpaper PRO yesterday, so happy with it.

    I have an idea for a better wallpaper-play: the live wallpaper must have 'in-wallpaper items' options where the user can buy different items for his/her live wallpaper, and so we could make only one live wallpaper version and the user doesn't need to install another version and he or she saves his/her time. We need a shop in the settings menu, where some things are free to use - this is the basic live wallpaper, but other things are paid - this is the pro version of the live wallpaper.

    Could you create such option in this amazing software you've created? Or could it be possible for us to integrate some third-part plugin doing that? Or maybe playmaker could create this? I will try playmaker too to see if i can create something like that.

    Best regards, Tina :)