Search Unity

OBSOLETE - Providing Android resources in Assets/Plugins/Android/res is deprecated...

Discussion in 'Android' started by almo, Apr 2, 2015.

  1. almo

    almo

    Joined:
    Jul 14, 2010
    Posts:
    83
    Hi!

    It's complaining about res/values/version.xml which contains

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    <integer name="google_play_services_version">6587000</integer>
    </resources>​

    Which says which version gets used in the manifest here:

    <meta-data android:name="com.google.android.gms.version" android:value="@Integer/google_play_services_version" />
    But the error further says:

    please move your resources to an Android Library
    Um... how do I move just an xml file like this to an entire Android Library?

    So really, what I need to know is how to put this version information into a project so the Android system can find it?
     
    Last edited: Apr 2, 2015
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    You can create a new Android Library project that doesn't have any code in it.
    Add your version.xml file to this project (under the res/values folder) and then copy the library (the entire folder structure) under Assets/Plugins.
     
  3. almo

    almo

    Joined:
    Jul 14, 2010
    Posts:
    83
    Ok, looks like that worked, thanks...

    I take that back. It built, but I still get an error from the device:

    I/Unity ( 5421): AndroidJavaException: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@Integer/google_play_services_version" />

    It appears that AndroidManifest.xml is not being included properly in the build.
     
    Last edited: Apr 7, 2015
  4. almo

    almo

    Joined:
    Jul 14, 2010
    Posts:
    83
    So I moved everything back to Assets/Plugins/Android, and now the plugin is working. But I still get the OBSOLETE message about res/values needing to be in its own library.
     
  5. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @almo, how are you adding the plugin? Looks like you are adding the jar file only, while the recommended way is to use Android library or AAR.
     
  6. almo

    almo

    Joined:
    Jul 14, 2010
    Posts:
    83
    But your documentation says we're supposed to use jar files:

    "You can drop pre-compiled Android library projects into the Assets->Plugins->Android folder. Pre-compiled means all .java files must have been compiled into jar files located in either the bin/ or the libs/ folder of the project. AndroidManifest.xml from these folders will get automatically merged with the main manifest file when the project is built."

    So are we supposed to use .aar files?
     
    neonblitzer likes this.
  7. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Well, we support the following plugin types for Android:

    - native .so files (you have to check the correct architecture for them in Plugin inspector)
    - compiled .jar files
    - Android library projects (preferred over jars, especially if you have resources or want to merge your manifest with Unity manifest)
    - AARs (same as Android library, but easier as this is a single file)

    You are free to choose whatever fits your needs. However, .jar + resources in res/ folder is not the setup we encourage. hence the warning.
     
    rumaniel likes this.
  8. almo

    almo

    Joined:
    Jul 14, 2010
    Posts:
    83
    Ok, thanks!

    I now have an aar file from Android Studio. Unity builds the project without errors now, but when I try to call a java function in the plugin, it says it can't find the class definition. I've checked the jar file inside the .aar, and the class definition is definitely in there.

    This was working with the jar file before, so is there something different I have to do to get the aar file to work properly?
     
  9. almo

    almo

    Joined:
    Jul 14, 2010
    Posts:
    83
    Scratch that, was a different device, running Android 2.3.3. Which wouldn't run the app anyway. All working, thanks for your help!
     
  10. pweeks

    pweeks

    Joined:
    Mar 29, 2011
    Posts:
    104
    so aar is supported in 4.x as well?
     
  11. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
  12. pweeks

    pweeks

    Joined:
    Mar 29, 2011
    Posts:
    104
  13. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Extremely unlikely. 5.1 is out, patch releases for 5.0 will fade out, I'm not sure if any of 4.6 patch releases are still planned.
     
  14. pweeks

    pweeks

    Joined:
    Mar 29, 2011
    Posts:
    104
    well there were just patches to 4.6...so maybe there is still hope
     
  15. pweeks

    pweeks

    Joined:
    Mar 29, 2011
    Posts:
    104
    if this support was added for 5.x i dont see why it shouldnt or couldnt be added to 4.x...it would really simplify life for all devs who havent or can't move to 5.x
     
  16. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @pweeks sorry no updates here - no plans to get aar support into 4.6.
     
  17. bugslammer

    bugslammer

    Joined:
    Jul 25, 2015
    Posts:
    2

    Hi @Yury Habets, can you please guide me to some documentation about the correct procedure and folder structure to add Android Library Projects to Unity plugins folder. A simple copy-paste of the project folder is not working for me. The player builds but the plugin doesn't work during execution. (whereas when I add a compiled .jar version of the plugin, it works)

    [EDIT]

    I'm using Unity 5.1.0f3.

    I believe the error is happening when the manifests are merged. After generating the "Google Android Project" from Unity Build settings, the merged manifest of the project is erroneous. The merged manifest contains TWO activities whereas it should contain only one. In the plugin, MainGameActivity extends UnityPlayerActivity The merged manifest looks as follows:

    Code (JavaScript):
    1. <manifest
    2.           ...
    3.           package="com.company.mygame" >
    4.          
    5.         <application
    6.                 ... >
    7.                 <activity
    8.                           ...
    9.                           android:name="com.company.mygame.UnityPlayerActivity" >
    10.                         <intent-filter>
    11.                                 <action android:name="android.intent.action.MAIN" />
    12.                                 <category android:name="android.intent.category.LAUNCHER" />
    13.                         </intent-filter>
    14.                        
    15.                         <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    16.                 </activity>
    17.                
    18.                 <activity android:name="com.company.mygame.MainGameActivity">
    19.                         <intent-filter>
    20.                                 <action android:name="android.intent.action.MAIN" />
    21.                                 <category android:name="android.intent.category.LAUNCHER" />
    22.                         </intent-filter>
    23.                 </activity>
    24.                
    25.                 <service android:exported="false" android:name="com.company.mygame.MainGameService" />
    26.         </application>
    27.         ...
    28. </manifest>


    Thanks.
     
    Last edited: Jul 26, 2015
  18. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Hi @bugslammer !

    Android Library projects should be added as a subdirectory in Assets/Plugins/Android, for example Assets/Plugins/Android/myandroidlibrary. It must contain project.properties file with android.library set to true, and AndroidManifest.xml - in that case it is recognized as an Android Library.

    Then goes the manifest merging logic.
    If you have your own manifest here: Assets/Plugins/Android/AndroidManifest.xml, it is taken as the base one, otherwise Unity default manifest is used as the base one.

    Next, it gets merged with all Android Libraries' manifests.

    Last step - properties, uses-features and permissions are set.

    Hope that helps. (I would probably need to write a blog post on this topic).
     
    JohnTube and Deleted User like this.
  19. bugslammer

    bugslammer

    Joined:
    Jul 25, 2015
    Posts:
    2
    @Yury Habets , I've followed all the steps outlined by you. Below I have attached a snapshot which shows my project's path, plugin's manifest and project.properties. The plugin manifest is present in the bin folder also. There is no separate manifest at <Assets/Plugins/Android/AndroidManifest.xml>.




    When I generate the 'apk' for the project and install it on the device, the device shows TWO new activities installed, i.e., two new icons in the apps menu to launch, and neither works correctly. I'm not quite sure how differently should I make the manifest.

    Thanks.
     
    Last edited: Jul 28, 2015
    leni8ec likes this.
  20. Nicholas-Rishel

    Nicholas-Rishel

    Joined:
    May 7, 2013
    Posts:
    16
    This would be exceptionally helpful. The "Plugins for Android" page only gives a paragraph on the topic of Android Library Projects and from it I wasn't able to decipher anything close to what you described above. Between that abd the multitude of outdated Eclipse tutorials it would be great to have an updated, solid baseline established.
     
  21. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @bugslammer
    Look at your plugin's manifest - it has MainGameActivity which has MAIN and LAUNCHER categories. Manifest merger does its job by merging it with main manifest, which results in two launchable activities.

    If you want the plugins' Activity to be MAIN+LAUNCHER - then you probably need to completely override the Android manifest by placing your full version into Assets/Plugins/Android/AndroidManifest.xml, and remove this attributes from UnityPlayerActivity.

    If you want UnityPlayerActivity to be your main - then modify the plugins' manifest by removing MAIN and LAUNCHER.
     
  22. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    Hi Yury,
    I am placing the aar files in Plugins/Android folder but the issue I am facing is after making apk when I am trying to find the class I am not able to find it.
     
  23. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    Getting ClassNotFound exception
    11-14 14:54:57.446: I/Unity(13333): AndroidJavaException: java.lang.ClassNotFoundException: verma.ashish.citrusplugintest.CitrusPaymentMainActivity
    11-14 14:54:57.446: I/Unity(13333): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>:0
    11-14 14:54:57.446: I/Unity(13333): at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unknown>:0
     
  24. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    Code:
    using(AndroidJavaClasspluginClass = newAndroidJavaClass("verma.ashish.citrusplugintest.CitrusPaymentMainActivity")) {
    if(pluginClass != null) {
    Debug.Log("Inside the not null check ");
     
  25. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
    I also went to the temp folder there is bin folder in which I found the classes folder it also contain same directory as my one(verma.ashish.citruspaymenttest) but it don't have any activity file. It contains only the R files. ? that might be the reason it is not accessing the required class
     
  26. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
  27. Contract-killer

    Contract-killer

    Joined:
    Sep 21, 2012
    Posts:
    42
  28. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Hold on crossposting this please :) I think we can handle it here.

    My answer on StackOverflow:

    "Looks like the .jar file with all your compiled code is missing in the .aar library.

    Unity compiles its own .jar file with all .jar files from all plugins together, into one .dex file.

    On Unity forums, you posted "class not found" error; here you mention "method not found". Anyway, something seems to be wrong with your .aar file."

    If you could post your .aar file - I will check and see whether there are any issues with your plugin, or Unity itself.
     
  29. balisi

    balisi

    Joined:
    Oct 15, 2015
    Posts:
    2
    Hi Yury, I got the "OBSOLETE" error while trying to use "res" folder to localize app name by providing strings.xml. I followed your instructions to use android library folder instead and the "OBSOLETE" warning is gone but I still don't get the app name from strings.xml. The app name is coming from product name in player settings instead.

    I have added following files under Assets/Libray/Android

    TestLib/AndroidManifest.xml
    Code (csharp):
    1. <manifestxmlns:android="http://schemas.android.com/apk/res/android"
    2. package="com.company.apps">
    3. <applicationandroid:allowBackup="false">
    4. </application>
    5. </manifest>
    TestLib/project.properties
    Code (csharp):
    1. target=android-19
    2. android.library=true
    TestLib/res/values/strings.xml
    Code (csharp):
    1. <?xmlversion="1.0" encoding="utf-8"?>
    2. <resources>
    3.   <string name="app_name">APP1</string>
    4. </resources>
    I'll appreciate any help with this.
     
  30. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @balisi : that's a valid question.
    Did it work for you if you were providing the resources in res/ folder?
    I guess there's something about the scope of the resource.
     
  31. balisi

    balisi

    Joined:
    Oct 15, 2015
    Posts:
    2
    No. It didn't work even when I used the res folder directly under Assets/Libray/Android.
     
  32. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Good. Can you please attach a small repro project here - I'll take a look?
     
  33. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    Hello,

    I have been using .jar file up until now because I did not need to use any graphic material with my android plugin. However, to display local notifications, a small icon is required and I found this thread.

    I have been trying to use the .AAR file as @Yury Habets suggested since it is just one file, without success.I think I might set up something wrong or I am missing a reference to the functionality somewhere.

    I tried swapping to Android Library Project, but again, the functionality is not working. Again, I am guessing I am not referencing things properly on my c# script, or I set up things in the wrong way, any advice?

    Unity Folder Structure: https://gyazo.com/f27b8a07520123400c1679a64db42e89
    AndroidManifest: https://gyazo.com/cff6b4e91314e8f6eb488a323b9c99d7
    MyAndLib Folder: https://gyazo.com/a37bda37cd59148a3f64c140aea4b067
    MyAndLib AndroidManifest: https://gyazo.com/27bfc9c887f0b61dd71c83ccb0d7e323
    MyAndLib Project Properties: https://gyazo.com/cb59a107a34fa4a99b77cb747f6e6ec9

    On a side note, any news regarding that blog entry about this topic? Would be very helpful.

    Thanks in advance.
     
    Last edited: Jan 22, 2016
  34. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Hi @inakiktp !

    Your Android library looks correct to me.
    Do all your resources get merged into the APK? You could check the APK contents or Temp/StagingArea/ directory of the project after you build it.

    What is exactly not working for you?
     
  35. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    Hi @Yury Habets

    My resources, which is just a .png to be used on Local Notifications, are not being added to the APK, nor I could find them inside Temp/StagingArea/ directory of the project after I built it. Unless I looked in the wrong place...

    Temp/StagingArea/ directory: https://gyazo.com/499472fbf246a064a8d0f2c4c6eabb39

    The "app_icon.png" that appears there is the icon from the Build Settings not the one I have on my Android Library Project: https://gyazo.com/1a613095ef2f5fe19ba37b0cfd71d7e4

    What is not working for me using the Android Library Project are two things:

    1) The Plugin Methods are not called, whereas if I use the .jar file (without changing the code or anything else) the Plugin Calls work. Do I need to change the way I reference the Plugin Static Methods while using an Android Library Project instead of a .jar file?

    I literally have 3 buttons linked to 3 methods from the script I use as a bridge between Unity and the Plugin: https://gyazo.com/4db71c5c72c990f27faac4e0325ecd24

    2) The resources I want to use are not being added, hence the Plugin cannot fire Local Notifications because it cannot find the .png file within the .apk, which puzzles me since you think the way I included it is alright.

    I believe the problem lies with me not adding correctly the Android Library Project to Unity, thus not adding the resources and not being able to find and execute the Plugin Methods nor the resources.

    I can put a together a test project if you fancy having a look yourself.
     
    Last edited: Jan 25, 2016
  36. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Hi!

    After building, please check that Temp/StagingArea/android-libraries dir contains your plugin. If it does not - then you are probably missing something, just post a simple project and I'll take a look.
     
  37. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    Hi @Yury Habets

    Well, definitely I was not looking in the right place. However, there is nothing inside Temp/StagingArea/android-libraries, is empty. So yeah, the plugin is not being added.

    Thanks for the help.
     
    Last edited: Feb 1, 2016
  38. guillermoi

    guillermoi

    Joined:
    Sep 20, 2012
    Posts:
    27
    Hey @inakiktp.

    I noticed in your project that your "project.properties" ends in ".xml" which as I understand should not be the case.
     
  39. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    Hey @guillermoi

    Thanks for pointing that out. I changed it and things started crashing all over the place, which I was glad something changed.

    Now I am getting a "Plugin Bundle ID" conflict which I never had before when using the .jar file. However, If I change the Unity Project Bundle ID to the same as the Android Library Project is using, I get a "Building DEX error" which I am not really sure how to interpret.

    I attached a file with the error. If anyone can shed some light about it I would appreciate it. I can tell it has something to do with the plugin, cannot tell more. :(
     

    Attached Files:

  40. guillermoi

    guillermoi

    Joined:
    Sep 20, 2012
    Posts:
    27
    Make sure you don't have duplicate Java code. Like 2 copies of the same JAR.
     
  41. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    Hey @guillermoi

    Thanks for the suggestion. As far as I am concerned, there should only be 1 JAR file which is the one wrapping the Unity3D Classes inside the Android Library Project: https://gyazo.com/eeea336d1c9919931a79c0348f44bf83

    I checked the other folders and I did not find any duplicates JAR files.

    I am sure all this trouble is coming from something not so complicated. Something similar happened when I started using the JAR file on my very first unity project with android an plugin.

    Edit:

    Maybe is that JAR wrapping Unity3D Classes. I am going try messing around it. Well, it built, thanks!

    However, now I am again at square one. The app works, but the functionality is not being executed, so I am guessing the Plugin Methods are not being called. However, this time, the plugin was included inside Temp/StagingArea/android-libraries/MyAndLib so happy about that.

    I feel I am running in circles, but at least this is a step forward. :D
     
    Last edited: Jan 27, 2016
  42. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    If you doubt any methods are actually being called - try adding logging there. You could add that on Unity side, and in the plugin on Java level as well.
     
  43. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    I am actually doing that.

    However, I think the problem lies more in the way I reference them is not alright because is not finding them. For example, with JAR I used this and worked:

    Code (CSharp):
    1. using (AndroidJavaClass unityPlayer = new AndroidJavaClass ("com.unity3d.player.UnityPlayer")) {
    2.      using (AndroidJavaObject unityBinder = new AndroidJavaObject ("com.seeable.androidplugin.UnityBridge")) {
    3.           unityBinder.CallStatic ("OpenGallery", unityPlayer.GetStatic<AndroidJavaObject> ("currentActivity"));
    4.      }
    5. }
    However, using the Android Library Project, it does not. It finds the unityPlayer, but not the unityBinder, which is null. That is why I believe it has to do with how I am referencing it, but I thought giving the package name + class name was the right way of doing it, at least that is what I got from every other tutorial about Android Plugins. Am I missing something?

    I tried changing where it should find the UnityBridge Class, without success. What I notice is that it seems to "crash" after this line of code:
    Code (CSharp):
    1. AndroidJavaObject unityBinder = new AndroidJavaObject ("com.seeable.androidplugin.UnityBridge")
    I mean, the app does not reset or anything, but the debugs stop coming through after that line of code, which is the first I have seen this behaviour.

    This might be a very stupid question but, does the Android Library Project need to have a .JAR file inside it?
     
    Last edited: Jan 27, 2016
  44. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    Hello,

    Just to update. I managed to get this working on a testing project. To be honest, it was not as difficult as I thought, but the lack of information about it made it extremely annoying and I needed to "try & error" a lot to figure it out.

    Nevertheless, my question now is, is there a way to make Android Library Projects not force you to use the same Bundle Id in the Unity Project as the Plugin uses?

    My Project Bundle Id was: com.Seeable.UAL
    My Plugin Bundle Id was: com.seeable.androidplugin

    I was able to have different Bundle Ids when I was using the .JAR file alone, however, after I moved to the Android Library Project, I am forced to use the Plugin Bundle Id (com.seeable) no matter what.

    It would be great if someone can clarify why it forces me to do so and if there is a way to change that.

    Edit:

    For those that arrive at this thread, the way I managed to make this work was this way:

    #1 Under Assets/Plugins/Android/ create a Folder with the name of your Plugin (or the name you prefer).

    #2 Inside "YourPlugin" Folder, drop the "res", "bin", "lib" folders, and the AndroidManifest.xml from your Android Library Project. In my case was only "res", and "bin", for graphics and the .jar file with the code.

    #3 Inside "YourPlugin" Folder, create a new "project.properties" file with the following contents
    Code (CSharp):
    1. # Project target.
    2. target=android-22
    3. android.library=true
    On "target", you have to specify the targetAPI of Android, in my case is 22.

    #4 Finally, under Assets/Plugins/Android/ add your AndroidManifest.xml with the Plugin permissions, features, etc that your Plugin will need.

    #5 Extra: Make sure there are no duplicated Classes and/or .Jar files among "YourPlugin" folder or other "Plugins" folder you may be using for your Project since those will produce a "Building DEX" Error.
     
    Last edited: Feb 9, 2016
    leni8ec likes this.
  45. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    I think I can explain that.
    You should use the same bundleid case for your game and all the plugins. If you don't, Unity will stop the build.

    The thing is that Java is case-dependent, while the file systems on Win and Mac are not. When resources are being merged and R.class is generated, one of the bundle IDs will be not found.

    So, we force the same case for bundle ids. This is an intentional change as a reply to the bug with similar bundleids that you posted.

    Why would you want to play games with bundle id cases? Are you expecting them to be handled in a separate Java namespace? Isn't java package name supposed to be lowercase? This is all playing with fire, and I see no profit of doing this way.
     
  46. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    Hello,

    Oh, ok, now I got a better picture of what was going on with the Bundle Ids, thanks for the clarification. To be honest, I always thought "Bundle Id" was a unique code for each thing. :p

    The reason why I was wondering if I could change it is because when I was using the .JAR file alone under Plugins/Android/.JAR + AndroidManifest.xml I could have different Bundle Ids and everything worked fine, at least, I did not find any problems.

    However, seeing as it is a bad idea, I will spend some time thinking a new name convention for my Apps and my Plugin.

    On a side note, I wonder, how is possible some Android Plugins from the Asset Store work out of the box having (I guess they are having) different Bundle Ids? I mean, the Plugin will have one and the Unity Project will have another.

    The only cases I am aware is not the case are the Facebook, and Prime31 Plugins. Or maybe am I wrong and this was possible due to the "old way" (which is obsolete now) of using Plugins?

    As you can note, my overall knowledge about Unity and Android and Plugins is still small, but well, I am happy I am learning (the hard way) all these things. xD
     
    Last edited: Feb 9, 2016
  47. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    The issue only happens at a stage when the resources are being merged.
    We get the following folder hierarchy:
    gen/
    = com/
    == Seeable/
    === UAL/R.java

    after that, gen/com/Seeable folder exists, so your plugin resources go to

    gen/
    = com/
    == Seeable/
    === UAL/R.java
    === androidplugin/R.java

    And the resources for the plugin get incorrect package ID com.Seeable.androidplugin (instead of com.seeable.androidplugin).

    A case sensitive file system would be able to handle that, but you better don't rely on that.

    When you were using jars, the resources were provided separately (probably in a res/ folder?). This is bad for resolving resource conflicts, so converting to Android library is a good step. And you have to resolve the mess with bundleids, and live happily. :)
     
  48. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    Hello!

    Thanks for the explanation @Yury Habets . Seeing as this is tied to resources and merging them, I am wondering:

    1) Is it possible to pass a resource from the Unity Project (say Resources folder) to the Android code? Say I want to pass an image.

    2) Or is it possible for the Android code to pick up resources from the Unity Project? Say I pass it a path to the resource and Android picks it up.

    I am guessing no, just asking.
     
  49. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @inakiktp : I'm not sure I quite understand what you mean by "pass an image/resource" :) Could you expand your questions, maybe with examples?

    Asset bundles are probably a good answer to all your questions, but I want to make sure this is what you are intended to do.
     
  50. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    @Yury Habets : Yeah, sorry, sometimes I explain myself awfully. :p

    For example, Local Notifications in Android require a small icon, is there a way for me to pass the path to this image (inside Unity Resources folder) to the Android code so it can use it? Hope it is clear now.

    I am aware, this may not be a good idea (I am not even sure this is possible), since it will not be adapted to the appropriate sizes and dpm of different resolutions, but I am basically curious if that way exists. ^^U
     
    Last edited: Feb 16, 2016