Before introducing GameActivity for Android in 2023.1, the way you get FrameLayout was updated.
In 2022.2, UnityPlayer extends FrameLayout.
In 2023.1 UnityPlayer doesn't extend FrameLayout. Instead, it offers getFrameLayout() API.
After introducing GameActivity for Android in 2023.1, Unity project exported using GameActivity entry point fails with the error like below:
C:\Projects\uaal-example-master\UnityProject\androidBuild\unityLibrary\src\main\java\com\company\product\OverrideUnityActivity.java:5: error: cannot find symbol
import com.unity3d.player.UnityPlayerActivity;
^
symbol: class UnityPlayerActivity
location: package com.unity3d.player
\
\
Solution:
Use mUnityPlayer.getFrameLayout() instead of mUnityPlayer
Separate the branch for Activity and use the master branch for GameActivity
\
Note:
Make sure that GameActivity is selected and Activity is not selected as the Application Entry Point in Player Settings (Android) when you use the master branch. For Activity, use 23LTS-UnityPlayerActivity branch.
Purpose of this PR
Jira link: https://jira.unity3d.com/browse/UUM-20370
\ The issue:
Before introducing GameActivity for Android in 2023.1, the way you get FrameLayout was updated.
In 2022.2, UnityPlayer extends FrameLayout.
In 2023.1 UnityPlayer doesn't extend FrameLayout. Instead, it offers getFrameLayout() API.
After introducing GameActivity for Android in 2023.1, Unity project exported using GameActivity entry point fails with the error like below:
\ \ Solution:
\ Note: Make sure that GameActivity is selected and Activity is not selected as the Application Entry Point in Player Settings (Android) when you use the master branch. For Activity, use 23LTS-UnityPlayerActivity branch.