Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Integration Unity as a library in native Android app Version 2

Discussion in '2019.3 Beta' started by PavelLU, Sep 27, 2019.

  1. FUBAR2077

    FUBAR2077

    Joined:
    Nov 16, 2013
    Posts:
    34
    I could use multiple Unity intents in one app as well, currently way to overcome this I see is launch loader scene in which you will pass parameter which scene in single Unity as a Library you want to launch and then it launches inside Unity intent.
    It still does not help with cases in which you need separate projects because lets say you want to have ARFoundation and Vuforia support in singe app which you cannot have in single Unity project. Mention me please if you will know how to solve this :)
     
  2. ArpitTyagi01

    ArpitTyagi01

    Joined:
    Feb 21, 2018
    Posts:
    14
    Unity app is working with AR but not working while using this as a library .
    Any update for this ?
     

    Attached Files:

  3. xwonder

    xwonder

    Joined:
    Jun 18, 2018
    Posts:
    7
    Hello,

    me and my team tried this approach (using an app with multiple unity games as different modules) but have after rigorous debugging (error after error after error...) come to the realization that such thing is not (yet) possible. We currenlty tackle the issue by implementing all unity apps in a single unity module where we use a launcher scene that launches different scenes. Hope this saves you some time.
     
  4. xwonder

    xwonder

    Joined:
    Jun 18, 2018
    Posts:
    7

    If anyone encounters the same issue: By changing parts of the gitignore file we found out, that the app works even when downloaded and built using VCS if we do not ignore the \bin folder.
     
  5. FUBAR2077

    FUBAR2077

    Joined:
    Nov 16, 2013
    Posts:
    34
    I managed to do this @ArpitTyagi01 - build as IL2CPP and then just do what I've described in one of previous posts

     
  6. ArpitTyagi01

    ArpitTyagi01

    Joined:
    Feb 21, 2018
    Posts:
    14
    Hello ,
    i am getting this error "DllNotFoundException: Unable to load DLL 'UnityARCore': The specified module could not be found." while using AR in unity as a library.
    any help ?
     
  7. ArpitTyagi01

    ArpitTyagi01

    Joined:
    Feb 21, 2018
    Posts:
    14
    Hey mate,
    This is not working as well getting the same error
     
  8. GaZnoDrone

    GaZnoDrone

    Joined:
    Mar 3, 2015
    Posts:
    28
    Thank you for the reply @xwonder but doesn't it create 2 different library modules having different bundle ID and project names. Theoretically, it shouldn't conflict, right? It may contain same contents but modules are different, I am not an android dev just curious to know why it wouldn't work. Cant, we encapsulate each of the modules, Project A and Project B, A.lib and B.lib even if the structure is the same it should not conflict I may be wrong here.

    One of the developers suggested Instant App feature, https://support.google.com/googleplay/answer/7683278?hl=en could this work.

    As a unity developer, I am trying to find out what can be done to make it possible, we wanted different modules to achieve this. In the long run, this has a lot of disadvantages. We want to provide a platform for other devs to launch their games on our base android app platform.
     
  9. GaZnoDrone

    GaZnoDrone

    Joined:
    Mar 3, 2015
    Posts:
    28
    @FUBAR2077 and @xwonder have the same solution, is this the only way. 2019.3.11b made the structure for exporting to a Gradle project to the android studio more compatible. Doesn't that fix or help in any way. Please do read the reply to @xwonder as well.
     
  10. ArpitTyagi01

    ArpitTyagi01

    Joined:
    Feb 21, 2018
    Posts:
    14
    Hello did you get the answer about this as i am getting the same error
     
  11. FUBAR2077

    FUBAR2077

    Joined:
    Nov 16, 2013
    Posts:
    34
    Did you copy your abiFilters line in build.gradle (Module: unityLibrary) as I wrote before?
     
  12. ArpitTyagi01

    ArpitTyagi01

    Joined:
    Feb 21, 2018
    Posts:
    14
    Yes i have done that too but i am getting error once click on Show unity that is DllNotFoundException: Unable to load DLL 'UnityARCore'
     
  13. xwonder

    xwonder

    Joined:
    Jun 18, 2018
    Posts:
    7
    In our case we have a single module made from a single unity project, so tehnically only 1 library module is created.

    It would be ideal if 2 modules didn't conflict and I don't know exactly why they do. One of the errors we encountered was something in the line of "dependencies specified more than once" which I interpreted as refferencing the same libraries in both modules, something that Android didn't allow.

    If what you said regarding 2019.3.11b is true using the newer beta versions might work? I am sceptical of it though and wouldn't go trying it out myself until someone from Unity explicitly states this is possible, but it's different for you since your service appears to be directly reliant upon this feature.

    Hope my answer helps and be sure to share it on this thread if you get it to work!
     
  14. ArpitTyagi01

    ArpitTyagi01

    Joined:
    Feb 21, 2018
    Posts:
    14
    Hello Ar plane detection is stuck with the camera(unity as a library) but working fine with unity app(single) ??
    any idea ??
     
  15. xwonder

    xwonder

    Joined:
    Jun 18, 2018
    Posts:
    7
    BUMP! Solved my libmain.so error!
    As for the reason why this works, apparently the ARKit plugin is not being built for ARMv7 (source:https://forum.unity.com/threads/lin...-ios-all-latest-versions.543935/#post-3588187). I'm assuming the same goes for ARFoundation since it also relies on ARKit.
     
    ROBYER1 likes this.
  16. ArpitTyagi01

    ArpitTyagi01

    Joined:
    Feb 21, 2018
    Posts:
    14
    Anyone facing AR issue with library in android like not able to find planes and character that placed is stuck with the camera ?
     
  17. FUBAR2077

    FUBAR2077

    Joined:
    Nov 16, 2013
    Posts:
    34
    I've managed to solve this, but I don't remember exactly how, I know I've been able to find something in adb logcat and then I've found an error
     
  18. SK_arctop

    SK_arctop

    Joined:
    Feb 12, 2018
    Posts:
    28
    Has anyone tried, if this even is possible, to use multiple projects from unity as libraries?
     
  19. shashkes

    shashkes

    Joined:
    Mar 16, 2017
    Posts:
    18
    Can anyone help with gradle issues? the demo project worked fine but when i tried to merge mine i'm getting:
    org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures.
    at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:386)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:247)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:159)
    at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:134)
    at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:58)
    at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:55)
    at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:82)
    at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:75)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:183)
    at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:75)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:55)
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:54)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:58)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:49)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:46)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
    at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:81)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:748)
    Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugJavaResource'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:151)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:148)
    at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:141)
    at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
    at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
    at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
    ... 6 more
    Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
    at org.gradle.workers.internal.DefaultWorkerExecutor$WorkerExecution.waitForCompletion(DefaultWorkerExecutor.java:285)
    at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:115)
    at org.gradle.internal.work.DefaultAsyncWorkTracker.access$000(DefaultAsyncWorkTracker.java:34)
    at org.gradle.internal.work.DefaultAsyncWorkTracker$2.run(DefaultAsyncWorkTracker.java:83)
    at org.gradle.internal.Factories$1.create(Factories.java:25)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLocks(DefaultWorkerLeaseService.java:254)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withoutProjectLock(DefaultWorkerLeaseService.java:165)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withoutProjectLock(DefaultWorkerLeaseService.java:159)
    at org.gradle.internal.work.StopShieldingWorkerLeaseService.withoutProjectLock(StopShieldingWorkerLeaseService.java:90)
    at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForCompletion(DefaultAsyncWorkTracker.java:79)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:412)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:393)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:376)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:213)
    at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$0(ExecuteStep.java:32)
    at java.util.Optional.map(Optional.java:215)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:32)
    at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
    at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)
    at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
    at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
    at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)
    at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)
    at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
    at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
    at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)
    at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
    at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)
    at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)
    at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:201)
    at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)
    at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)
    at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
    at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)
    at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)
    at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
    at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
    at java.util.Optional.map(Optional.java:215)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
    at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
    at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:77)
    at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
    at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
    at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
    at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
    at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:120)
    ... 38 more
    Caused by: java.nio.file.FileSystemException: C:\$Data\AndroidCarbon0\app\build\intermediates\merged_java_res\debug\out.jar: The process cannot access the file because it is being used by another process.
    at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
    at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
    at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
    at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
    at java.nio.file.Files.deleteIfExists(Files.java:1165)
    at com.android.utils.FileUtils.deleteIfExists(FileUtils.java:229)
    at com.android.build.gradle.internal.tasks.MergeJavaResRunnable.run(MergeJavaResRunnable.kt:44)
    at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:335)
    at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:39)
    at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.execute(NoIsolationWorkerFactory.java:61)
    at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
    at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
    at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:55)
    at org.gradle.workers.internal.DefaultWorkerExecutor$1.call(DefaultWorkerExecutor.java:105)
    at org.gradle.workers.internal.DefaultWorkerExecutor$1.call(DefaultWorkerExecutor.java:99)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
    at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
    at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    ... 6 more
     
  20. shashkes

    shashkes

    Joined:
    Mar 16, 2017
    Posts:
    18
    so after I gave up on integrading the unity project that had firebase in it because of too many merge conflicts, i took firebase out, exported again and the project built with no conflicts, but when I try to run and open the MainUnityActivity that I created that extends UnityPlayerActivity the app it crashes after starting.
    I just want to run the unityapp straight from the start, can someone give some example code how to do that?
    The sample app has three different stages with MainUnityActivity Extending OverideUnityActivity which extends UnityPlayerActivity.
    How do I just call the UnityPlayerActivity straight from the start?
     
  21. xwonder

    xwonder

    Joined:
    Jun 18, 2018
    Posts:
    7
    You set the UnityPlayerActivity as the launch activity. In the AndroidManifest you add:
    Code (CSharp):
    1.  
    2. <intent-filter>
    3.     <action android:name="android.intent.action.MAIN" />
    4.  
    5.     <category android:name="android.intent.category.LAUNCHER" />
    6. </intent-filter>
    7.  
    in the activity tag representing the UnityPlayerActivity and be sure to delete it from its previous place.
    So it would look something like this:
    Code (CSharp):
    1. <activity
    2.             android:name=".activities.MainUnityActivity"
    3.             android:launchMode="singleTask"
    4.             android:process=":UnityKillsMe"
    5.             android:screenOrientation="portrait">
    6.             <intent-filter>
    7.             <action android:name="android.intent.action.MAIN" />
    8.             <category android:name="android.intent.category.LAUNCHER" />
    9.             </intent-filter>
    10.         </activity>
    I have not tried if this works (it should) but if it doesn't there is always the workaround of immediately launching the UnityPlayerActivity upon arriving to your starting activity, so at the start of onCreate() do:
    Code (CSharp):
    1. Intent i = new Intent(getApplicationContext(), MainUnityActivity.class);
    2.         startActivity(i);
     
  22. yurykorzun

    yurykorzun

    Joined:
    Oct 29, 2015
    Posts:
    41
    Is it possible to preload a UnityPlayer in background? It looks like on iOS it is possible to initialize unity while the app Splash screen, but on Android Unity has to fully load everything when we transition to UnityActivity for the first time.
     
    meta_monkey likes this.
  23. subjectdenied

    subjectdenied

    Joined:
    Jan 3, 2016
    Posts:
    3
    i solved this by importing the aar files as modules and using implementation project(...) instead of implementation(name: ...)
     
  24. Cinqed

    Cinqed

    Joined:
    May 30, 2017
    Posts:
    18
    Hi. Any chance you'd share a sample project with settings that got it all working in GitHub or somewhere?

    Thanks!
    Dave G
     
  25. Cinqed

    Cinqed

    Joined:
    May 30, 2017
    Posts:
    18
    Hi All,
    I'm asking for help on lots of fronts on this one. Here's the latest. I'm trying to follow the walk-through and it's breaking right at the beginning when I try and build the uaal unity project for Export I get build errors. Don't think I changed anything. Using 2019.3.0f3

    2020-01-04_19-09-36.jpg
     
  26. Cinqed

    Cinqed

    Joined:
    May 30, 2017
    Posts:
    18
    Clarifiying that this is the github example code.
     
  27. agpatel0007

    agpatel0007

    Joined:
    Aug 21, 2014
    Posts:
    9
    any luck ? facing same problem

    ERROR :
    AndroidVideoMedia::OpenExtractor could not translate sharedassets0.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed.
     
  28. agpatel0007

    agpatel0007

    Joined:
    Aug 21, 2014
    Posts:
    9

    Found a solution for the video
    add this lines in app/build.gradle

    android {
    ....
    ....
    aaptOptions {
    noCompress '.unity3d', '.ress', '.resource', '.obb'
    }
    ....
    }
     
  29. VastDev

    VastDev

    Joined:
    Oct 19, 2018
    Posts:
    5
    Hello guys, currntly face with these gradle.error in Android intregrating. If anyone know the solution please help
    (the project has been exported to be integrating with other dev's android project in no Unity installed machine could that be the error's cause?)

    Here is the errors:
    org.gradle.process.internal.ExecException: Process 'command '/Applications/Unity/Hub/Editor/2020.1.0a18/Unity.app/Contents/MonoBleedingEdge/bin/mono'' finished with non-zero exit value 1
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:396)
    at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:37)
    at org.gradle.process.internal.DefaultExecActionFactory.exec(DefaultExecActionFactory.java:136)
    at org.gradle.groovy.scripts.DefaultScript.exec(DefaultScript.java:260)
    at org.gradle.api.Script$exec$0.callCurrent(Unknown Source)
     
  30. ExtremeKaos

    ExtremeKaos

    Joined:
    Dec 4, 2016
    Posts:
    7
    Hi, im integrating unity project into test app (uaal-example). Have change the example project from unity (2020) to use iLcpp and arm64. When i follow the tutorial have some "problems".

    1º With Mono works ok , but with iLCpp fires "Project with path ':launcher' could not be found in project ':unityLibrary' in build.grade (unityLibrary). Is associated to launcher, i guess , that handles direct execution of the android app , not for integration in other android project. Have commented the lines ... , then compiled.

    afterEvaluate {
    if (project(':launcher').tasks.findByName('mergeDebugJniLibFolders'))
    project(':launcher').mergeDebugJniLibFolders.dependsOn BuildIl2CppTask
    if (project(':launcher').tasks.findByName('mergeReleaseJniLibFolders'))
    project(':launcher').mergeReleaseJniLibFolders.dependsOn BuildIl2CppTask
    }


    2º Build project, and the same project thats worked with Mono export, now crash when unity intent is fired. Sorry for the long trace...


    [SIZE=3]2020-02-08 20:21:29.637 13812-13812/com.unity.mynativeapp W/ResourceType: [B]No package identifier when getting name for resource number 0x00000000[/B]
    2020-02-08 20:21:29.775 13812-13812/com.unity.mynativeapp W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
    2020-02-08 20:21:29.786 13812-13812/com.unity.mynativeapp D/AccessibilityManager: current package=com.unity.mynativeapp, accessibility manager mIsFinalEnabled=false, mOptimizeEnabled=false, mIsUiAutomationEnabled=false, mIsInterestedPackage=false
    2020-02-08 20:21:29.808 13812-13812/com.unity.mynativeapp I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
    2020-02-08 20:21:29.808 13812-13812/com.unity.mynativeapp I/art: at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
    2020-02-08 20:21:29.808 13812-13812/com.unity.mynativeapp I/art: at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
    2020-02-08 20:21:29.808 13812-13812/com.unity.mynativeapp I/art: at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
    2020-02-08 20:21:29.808 13812-13812/com.unity.mynativeapp I/art: at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
    2020-02-08 20:21:29.808 13812-13812/com.unity.mynativeapp I/art: at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
    2020-02-08 20:21:29.808 13812-13812/com.unity.mynativeapp I/art: at void com.unity.mynativeapp.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:19)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6845)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1119)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2700)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2808)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1541)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.os.Looper.loop() (Looper.java:165)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6375)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:912)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:802)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art:[B] Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.unity.mynativeapp-2/base.apk"],nativeLibraryDirectories=[/data/app/com.unity.mynativeapp-2/lib/arm64, /data/app/com.unity.mynativeapp-2/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]][/B]
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:74)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void com.unity.mynativeapp.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:19)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6845)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1119)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2700)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2808)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1541)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.os.Looper.loop() (Looper.java:165)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6375)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:912)
    2020-02-08 20:21:29.809 13812-13812/com.unity.mynativeapp I/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:802)[/SIZE]
     
  31. ExtremeKaos

    ExtremeKaos

    Joined:
    Dec 4, 2016
    Posts:
    7
    If can help to anyone...

    1º Have to change ':launcher' for ':app' (default implementation of my main project), for gradle to copy mandatories librarys.

    2º Change version of unity beta 2020 to the last and remove unity libs (previous to change to implementation as library)


     
  32. Flindt

    Flindt

    Joined:
    Dec 28, 2016
    Posts:
    77
    Hi

    Im trying to implement a small unity setup into androi app. It is just a low poly tree - that should animate and blow in the wind.
    I have tested a lot of different approaches - like rendering to 2d animaton - and using Spine and different other setups - but now i see this can maybe work.

    But we need library to be very very small when build - so does anyone know how big it is as minimum? - can it be split up so that you only load the parts you need?

    Is it possible to have anything in a build - that is below 2-3 mb?

    Thanks a lot
     
  33. SozoDev

    SozoDev

    Joined:
    Nov 15, 2016
    Posts:
    12
    Does anyone know how to do this in Xamarin? Someone posted on their forum that they successfully did it, but couldn't share how to. Even high level steps would be helpful.
     
  34. PaulinePEY

    PaulinePEY

    Joined:
    Oct 23, 2015
    Posts:
    4
    Hi.
    My android studio project doesn't build when my unity project countains ARKit or ARCore packages.
    I tried to build an AR project with dll in the asset folder and it works. But when I use the package manager to download AR packages, I have compilation errors in Android Studio. Here are my errors :
    Execution failed for task ':unityLibrary:javaPreCompileDebug'.
    > Could not resolve all files for configuration ':unityLibrary:debugCompileClasspath'.
    > Failed to transform file 'ARPresto.aar' to match attributes {artifactType=android-classes, org.gradle.usage=java-api}
    > Execution failed for AarToClassTransform: C:\Users\timma\.gradle\caches\transforms-2\files-2.1\97d426d5dfee9298eb2c78efce7fc557\jetified-ARPresto.aar.
    > entry
    > Failed to transform file 'UnityARCore.aar' to match attributes {artifactType=android-classes, org.gradle.usage=java-api}
    > Execution failed for AarToClassTransform: C:\Users\timma\.gradle\caches\transforms-2\files-2.1\041f0077f853f2224b3930b09f1c2936\jetified-UnityARCore.aar.
    > entry
    > Failed to transform artifact 'ARPresto.aar :)ARPresto:)' to match attributes {artifactType=android-classes, org.gradle.usage=java-api}.
    > Execution failed for AarToClassTransform: C:\Users\timma\.gradle\caches\transforms-2\files-2.1\97d426d5dfee9298eb2c78efce7fc557\jetified-ARPresto.aar.
    > entry
    > Failed to transform artifact 'UnityARCore.aar :)UnityARCore:)' to match attributes {artifactType=android-classes, org.gradle.usage=java-api}.
    > Execution failed for AarToClassTransform: C:\Users\timma\.gradle\caches\transforms-2\files-2.1\041f0077f853f2224b3930b09f1c2936\jetified-UnityARCore.aar.
    > entry
    Am I missing something in the android project configuration ?
    Is anyone facing the same issue ? How do you make an AR project using package manager working ?
     
  35. obywan

    obywan

    Joined:
    Jan 18, 2014
    Posts:
    7
    Ok, I finally got ARFoundation working. I might done something stupid or redundant but just in case someone will need a guide here it is:
    1. Get example project from github
    2. Add AR functionality to it
    3. Export (il2cpp, arm64, Texture compression: ETC2, Auto graphics API)
    4. Open exported project with Android Studio
    5. Import arcore_client, unityandroidpermissions, UnityARCore as modules (do not remove originals).
    6. Change implementation to:
      implementation project(':arcore_client')
      implementation project(':unityandroidpermissions')
      implementation project(':UnityARCore')
    7. Sync
    8. Close exported project and open NativeAndroidApp
    9. Set it up like in instructions at the beginning
    10. Import modules again like in step 5
    11. Sync
    12. Fix 'min sdk version' error if you see one
    13. Done.
     
    Last edited: Mar 17, 2020
    GSO_GT likes this.
  36. bugaboostudio

    bugaboostudio

    Joined:
    Sep 30, 2016
    Posts:
    3
    Hi guys, is anyone having problem ralated to unresolved libraries?
    I'm using NarCorder asset and getting those bugs.


     

    Attached Files:

  37. lmalave

    lmalave

    Joined:
    Dec 29, 2014
    Posts:
    5
    Hi, I am able to successfully build and run this example app, but I am having problems applying the same approach to my React Native app. I am able to successfully start the Unity activity, but when I try to finish the activity, the entire application closes.

    One change I made from the example is that I don't have the Unity activity running in a separate process. However, in my React Native app I see the same behavior even when running as a separate process - the application still exits on showMainActivity(). The reason I need the Unity activity running in the same process as MainActivity is it's necessary for Unity to communicate back to the React Native view.

    Has anyone successfully integrated an Android React Native app with the Unity-as-a-Library approach in Unity 2019.3?
     
  38. Kasfan

    Kasfan

    Joined:
    Oct 30, 2013
    Posts:
    3
    Has anybody tried to bind a Unity project with ARFoundation or ARCore to Xamarin?
    In Android Studio my project works well. I also managed to run another project without ARCore inside Xamarin.
    But I keep getting DllNotFoundException: UnityARCore error with ARCore being added to my project.


    DllNotFoundException: UnityARCore
    at (wrapper managed-to-native) UnityEngine.XR.ARCore.ARCoreImageTrackingProvider+ARCoreProvider.UnityARCore_imageTracking_acquireChanges(void*&,int&,void*&,int&,void*&,int&,int&)
    at UnityEngine.XR.ARCore.ARCoreImageTrackingProvider+ARCoreProvider.GetChanges (UnityEngine.XR.ARSubsystems.XRTrackedImage defaultTrackedImage, Unity.Collections.Allocator allocator) [0x00000] in <b46ea33bc1344363b51822f082ac27a6>:0
    at UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem.GetChanges (Unity.Collections.Allocator allocator) [0x0000b] in <7c0a1e68529747d4adc9623a02059ed7>:0
    at UnityEngine.XR.ARFoundation.ARTrackableManager`4[TSubsystem,TSubsystemDescriptor,TSessionRelativeData,TTrackable].Update () [0x00020] in <b20017c69be949538d5b5710f19f5eb8>:0


    Obviously, there are no UnityARCore.aar, acrore_client.aar, unityandroidpermissions.aar and ARPresto.aar in an exported aar file of my project. Still have no idea how to add them
     
  39. aleyooop

    aleyooop

    Joined:
    Jul 10, 2017
    Posts:
    1
    Simply use gradle 3.1.4 instead of new versions.
     
  40. Overature

    Overature

    Joined:
    May 10, 2020
    Posts:
    9
    May 2020, I have this working following the tutorial with Unity 2019.3.0f6 and Android Studio 3.4.2. Exported from unity with the following export settings in Unity (Player setting - Configurations). upload_2020-5-10_17-21-2.png
     
  41. AkashChetty

    AkashChetty

    Joined:
    Jul 15, 2019
    Posts:
    2
    After integrating the Unity project as a module and calling UnityPlayerActivity It is showing a popup saying `Not enough storage resources space to install required resources.`
    If I see in the logs this is not being called ->
    2020-05-11 07:23:36.896 17965-18002/? D/Unity: Loading player data from /data/app/com.automation.augarunityandroid-8FV1_SlxATVeFTA58_lVUg==/base.apk/assets/bin/Data/data.unity3d

    Instead this is being called ->
    2020-05-11 07:40:51.103 19056-19112/com.automation.augar.develop D/Unity: il2cpp failed to extract resources (assets/bin/Data/Managed => /storage/emulated/0/Android/data/com.automation.augar.develop/files/il2cpp)
     
  42. AkashChetty

    AkashChetty

    Joined:
    Jul 15, 2019
    Posts:
    2
    If I export a Project from Unity and build it through Android studio then it is working. But the same exported Project if I import in Android studio as a Library module with changes in the following section:
    1. Removing <intent-filter> Launcher code from unityLibrary/AndroidManifest.xml
    2. Changing apply plugin: 'com.android.application' to apply plugin: 'com.android.library' in launcher/build.gradle
    3. Removing applicationId from launcher/build.gradle

    Then I am getting the above error I calling UnityPlayerActivity.
     
  43. Overature

    Overature

    Joined:
    May 10, 2020
    Posts:
    9
    Does anybody have a working example of a simple app where you push a button to launch a unity app? I have this example but can't get rework it for my own code. Thanks.
     
  44. Overature

    Overature

    Joined:
    May 10, 2020
    Posts:
    9
  45. pushpendra996

    pushpendra996

    Joined:
    Dec 8, 2018
    Posts:
    4
    I have tried as per the suggestion. And it's working fine for a single Unity Module. But when I am trying the same thing with multiple unity modules then it starts giving error.

    So for solving those error I have re change the package name of my second game library and I add one line inside my native android application.

    Code (CSharp):
    1.     packagingOptions {
    2.         pickFirst '**/*.so'
    3.     }
    After that, It Builds and syncs successfully. Now the problem is that When I am starting first unityLibrary game activity then it's opening first Unity game. This is fine.

    But when I am opening second Unity Game Activity then also it is opening the first Unity Game. How it could be possible. I am not understanding. I have tried many solutions but did not get any success in this. Please help me someone so that I can use multiple unity library for a single native android application.

    Below is the code, Which I am using for opening each Unity Game Activity.
    Code (CSharp):
    1. import android.app.Activity;
    2. import android.content.Intent;
    3. import android.os.Bundle;
    4. import android.util.Log;
    5.  
    6. import com.game.player.GamePlayerActivity;
    7. import com.unity3d.player.UnityPlayerActivity;
    8.  
    9.  
    10. public class GameHolderActivity extends Activity {
    11.     private String TAG = "GAME_HOLDER_ACTIVITY";
    12.  
    13.     @Override
    14.     protected void onCreate(Bundle savedInstanceState) {
    15.         super.onCreate(savedInstanceState);
    16.         setContentView(R.layout.activity_first_game);
    17.  
    18.         if (getIntent().hasExtra("game") && getIntent().getIntExtra("game", 0) == 1) {
    19.             Log.d(TAG, "FIRST_GAME");
    20.             Intent intent = new Intent(GameHolderActivity.this, UnityPlayerActivity.class);
    21.             startActivity(intent);
    22.         } else {
    23.             Log.d(TAG, "SECOND_GAME");
    24.             Intent intent = new Intent(GameHolderActivity.this, GamePlayerActivity.class);
    25.             startActivity(intent);
    26.         }
    27.     }
    28. }
    I will very thankful for any help!
     
  46. Overature

    Overature

    Joined:
    May 10, 2020
    Posts:
    9
    I ran into the same problem, my current attempt (which is not working) is to have one unity project with multiple scenes where your second button loads the second scene which would be the second unity project that you wanted.
     
  47. joasus12345

    joasus12345

    Joined:
    Dec 26, 2018
    Posts:
    12
    Does the unity version and android studio gradle/sdk versions matter? Hope that it works with newer versions. I was running into some errors. Ill see if I can resolve them
     
  48. joasus12345

    joasus12345

    Joined:
    Dec 26, 2018
    Posts:
    12
    Is there a slimmer build available? One without the 90mb overhead?
     
  49. hyperhuzaifa

    hyperhuzaifa

    Joined:
    Aug 21, 2015
    Posts:
    6
    How do you reduce Unity process start-up time? An IL2CPP apk install takes about 220 ms (if you remove the splash screen) on a Snapdragon 855. The same build will take close to 2500 ms on Unity as a library build (and 3500 ms on Mono).
    What gives?
     
  50. trigger-james

    trigger-james

    Joined:
    Aug 14, 2019
    Posts:
    5
    Hey everyone, I'm having some issues with my project that contains several other .aar files. I can build everything out and incorporate my unityLibrary module into the NativeAndroidApp sample project but I run into issues when syncing gradle and when attempting to run.

    What I'm seeing is the following message: "Failed to resolve: :{AARFileName}:" for every included .aar file in my unityLibrary module.

    My dependencies section of my unityLibrary build.gradle file uses the following to compile my aar files:

    Code (JavaScript):
    1. dependencies {
    2.     implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
    3.     implementation(name: 'NatCam', ext:'aar')
    4.     implementation(name: 'NatRender', ext:'aar')
    5.     implementation(name: 'some-example-1', ext:'aar')
    6.     implementation(name: 'some-example-2', ext:'aar')
    7.     implementation(name: 'support-v4-23.4.0', ext:'aar')
    8. }
    Is there anything inherently incorrect about the way these aar files are implemented in the unityLibrary build.gradle file? Or is there another solution to ensuring my aar files are compiled correctly?

    Thanks for the help!
     
unityunity