I have read all the documentation I found on how to integrate Unity3D projects targeted to Android into eclipse. The reason I want to do that is to be able to call the Unity3D Activity within my own "normal" Android application.
Well, I tried to follow the steps listed on this tutorial. Using all the combinations I can imagine, I did the following:
I used the Unity Android project and built it (within the Unity IDE), then copied the
/Temp/StagingArea/
folder to another location.I created a new Android project, using create from existing sources, setting the location of the
StagingArea
copy folder. This would be the Android Library Project. Check "is Library" on properties -> Android.Again, I create an Android project, import the previusly created Android Library project and
classes.jar
.I move the
asset
folder contents from the Library project to the "Activity" project. It has two subfolders,bin
andlibs
.I modify the generated Activity to extend
UnityPlayerActivity
and remove the setContent line of the onCreate method. Change the package to match the Unity Player bundle id.Add the corresponding lines to manifest, basically those that are on the Library project.
So everything compiles without errors, and I can run the project, shows the splash screen, and then a black screen, playing the sounds of my Unity Scene correctly. The logcat reveals the following errors:
01-26 16:51:46.415: D/dalvikvm(2299): Trying to load lib /data/data/es.fundacionvf.unity.gps/lib/libQCARWrapper.so 0x40515a38
01-26 16:51:46.415: E/Unity(2299): Unable to find QCARWrapper
01-26 16:51:46.415: D/dalvikvm(2299): Trying to load lib /data/data/es.fundacionvf.unity.gps/lib/libQCARWrapper.so 0x40515a38
01-26 16:51:46.415: E/Unity(2299): Unable to find QCARWrapper
01-26 16:51:46.415: D/dalvikvm(2299): Trying to load lib /data/data/es.fundacionvf.unity.gps/lib/libQCARWrapper.so 0x40515a38
01-26 16:51:46.415: E/Unity(2299): Unable to find QCARWrapper
01-26 16:51:46.415: I/Unity(2299): StopQCAR
01-26 16:51:46.415: I/Unity(2299): UnityEngine.Debug:Internal_Log(Int32, String, Object)
01-26 16:51:46.415: I/Unity(2299): UnityEngine.Debug:Log(Object)
01-26 16:51:46.415: I/Unity(2299): UnityEngine.MonoBehaviour:print(Object)
01-26 16:51:46.415: I/Unity(2299): TrackerBehaviour:StopQCAR()
01-26 16:51:46.415: I/Unity(2299): TrackerBehaviour:OnApplicationPause(Boolean)
01-26 16:51:46.415: I/Unity(2299):
01-26 16:51:46.415: I/Unity(2299): (Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/Export/Generated/UnityEngineDebug.cpp Line: 34)
01-26 16:51:46.425: D/dalvikvm(2299): Trying to load lib /data/data/es.fundacionvf.unity.gps/lib/libQCARWrapper.so 0x40515a38
01-26 16:51:46.425: E/Unity(2299): Unable to find QCARWrapper
01-26 16:51:46.425: I/Unity(2299): DllNotFoundException: QCARWrapper
01-26 16:51:46.425: I/Unity(2299): at (wrapper managed-to-native) TrackerBehaviour:stopTracker ()
01-26 16:51:46.425: I/Unity(2299): at TrackerBehaviour.StopQCAR () [0x00000] in <filename unknown>:0
01-26 16:51:46.425: I/Unity(2299): at TrackerBehaviour.OnApplicationPause (Boolean pause) [0x00000] in <filename unknown>:0
Just to mention... read these two SO questions: 1 and 2. They seem to have succeded, so it is possible to achieve following those steps (or similar).
I also found useful this topic on the Unity3D forum, which basically describes the same proccess in a clearer way.
Has anybody experienced this issue? Any suggestion or alternative?
Regards.