Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GitHub actions failing #135

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Renderer
name: Build ViroCore Renderer

on:
push:
Expand All @@ -8,13 +8,14 @@ on:

jobs:
androidBuild:
name: Android Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.3.0
- name: set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
distribution: "adopt"
java-version: 11

- name: assemble ViroCore
Expand All @@ -30,8 +31,8 @@ jobs:
./android/viroreact/build/outputs/aar/*.aar
./android/viroar/build/outputs/aar/*.aar

AndroidCheck:
name: Check
androidCheck:
name: Android Lint Check
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -57,13 +58,14 @@ jobs:
./**/build/reports/lint-results.html
./**/**/build/reports/lint-results.html

iosBuild:
iOSBuild:
name: iOS Build
runs-on: ${{ matrix.macOS }}
strategy:
fail-fast: false
matrix:
xcode: [ '12.5.1', '13.2.1' ]
macOS: [ 'macOS-11' ]
xcode: ["14.2.0", "13.4.1"]
macOS: ["macos-12"]
steps:
- uses: actions/checkout@v3.3.0
- name: Install gpg
Expand All @@ -79,12 +81,12 @@ jobs:
- name: Xcodebuild iOS Renderer (non-static)
run: |
cd ios
xcodebuild \
set -o pipefail && xcodebuild \
-workspace ViroRenderer.xcworkspace \
-scheme ViroKit \
-sdk iphoneos \
-configuration Release \
IPHONEOS_DEPLOYMENT_TARGET=9.0
IPHONEOS_DEPLOYMENT_TARGET=13.0 | xcpretty

- name: Upload iOS Renderer artifact
uses: actions/upload-artifact@v3.1.2
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions android/memoryleaktest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ apply plugin: 'kotlin-android'
android {
flavorDimensions "target_platform"

compileSdkVersion 31
compileSdkVersion 33
defaultConfig {
applicationId "com.example.memoryleaktest"
minSdkVersion 24
targetSdkVersion 31
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand Down
4 changes: 4 additions & 0 deletions android/memoryleaktest/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.memoryleaktest">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<queries>
<package android:name="com.google.ar.core" />
</queries>
Expand Down
4 changes: 2 additions & 2 deletions android/nativetest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.application'

android {
flavorDimensions "target_platform"
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
applicationId "com.viro.nativetest"
minSdkVersion 24
targetSdkVersion 31
targetSdkVersion 33
versionCode 1
versionName "1.0"
missingDimensionStrategy 'product', 'viro_core'
Expand Down
6 changes: 5 additions & 1 deletion android/nativetest/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.viromedia.nativetest">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<queries>
<package android:name="com.google.ar.core" />
</queries>

<!-- Required to read the paired viewer's distortion parameters -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />-->

<!-- Required for AR -->
<uses-permission android:name="android.permission.CAMERA" />
Expand Down
4 changes: 2 additions & 2 deletions android/releasetest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'kotlin-android'

android {
flavorDimensions "target_platform"
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
applicationId "com.viromedia.releasetest"
minSdkVersion 24
targetSdkVersion 31
targetSdkVersion 33
versionCode 1
versionName "1.0"

Expand Down
6 changes: 5 additions & 1 deletion android/releasetest/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.viromedia.releasetest">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<queries>
<package android:name="com.google.ar.core"/>
</queries>

<!-- Required to read the paired viewer's distortion parameters -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />-->

<!-- Required for AR -->
<uses-permission android:name="android.permission.CAMERA" />
Expand Down
4 changes: 2 additions & 2 deletions android/renderertest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.application'

android {
flavorDimensions "target_platform"
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
applicationId "com.viromedia.renderertest"
minSdkVersion 24
targetSdkVersion 31
targetSdkVersion 33
versionCode 1
versionName "1.0"
missingDimensionStrategy 'product', 'viro_core'
Expand Down
6 changes: 5 additions & 1 deletion android/renderertest/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.viromedia.renderertest">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<queries>
<package android:name="com.google.ar.core" />
</queries>

<uses-permission android:name="android.permission.INTERNET" />

<!-- Required to read the paired viewer's distortion parameters -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />-->

<!-- Required for AR -->
<uses-permission android:name="android.permission.CAMERA" />
Expand Down
2 changes: 1 addition & 1 deletion android/sharedCode/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE"/>
<!-- Required to read the paired viewer's distortion parameters. -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>-->
<!-- Required for Recording -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
Expand Down Expand Up @@ -71,7 +72,7 @@ private enum State {
STARTED,
}

private final SimpleExoPlayer mExoPlayer;
private final ExoPlayer mExoPlayer;
private float mVolume;
private final long mNativeReference;
private boolean mLoop;
Expand All @@ -88,13 +89,12 @@ public AVPlayer(long nativeReference, Context context) {
mMute = false;

AdaptiveTrackSelection.Factory trackSelectionFactory = new AdaptiveTrackSelection.Factory();
DefaultTrackSelector trackSelector = new DefaultTrackSelector(trackSelectionFactory);
mExoPlayer = new SimpleExoPlayer.Builder(context).setTrackSelector(trackSelector).setLoadControl(new DefaultLoadControl()).build();

mExoPlayer.addListener(new Player.EventListener() {
DefaultTrackSelector trackSelector = new DefaultTrackSelector(context, trackSelectionFactory);
mExoPlayer = new ExoPlayer.Builder(context).setTrackSelector(trackSelector).setLoadControl(new DefaultLoadControl()).build();

mExoPlayer.addListener(new Player.Listener() {
@Override
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
public void onPlaybackStateChanged(@Player.State int playbackState) {
// this function sometimes gets called back w/ the same playbackState.
if (mPrevExoPlayerState == playbackState) {
return;
Expand Down Expand Up @@ -175,34 +175,34 @@ public DataSource createDataSource() {
private MediaSource buildMediaSource(Uri uri, DataSource.Factory mediaDataSourceFactory, ExtractorsFactory extractorsFactory) {
int type = inferContentType(uri);
switch (type) {
case C.TYPE_SS:
return new SsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri);
case C.TYPE_DASH:
return new DashMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri);
case C.TYPE_HLS:
return new HlsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri);
case C.CONTENT_TYPE_SS:
return new SsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(MediaItem.fromUri(uri));
case C.CONTENT_TYPE_DASH:
return new DashMediaSource.Factory(mediaDataSourceFactory).createMediaSource(MediaItem.fromUri(uri));
case C.CONTENT_TYPE_HLS:
return new HlsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(MediaItem.fromUri(uri));
default:
// Return an ExtraMediaSource as default.
return new ProgressiveMediaSource.Factory(mediaDataSourceFactory, extractorsFactory).createMediaSource(uri);
return new ProgressiveMediaSource.Factory(mediaDataSourceFactory, extractorsFactory).createMediaSource(MediaItem.fromUri(uri));
}
}

private int inferContentType(Uri uri) {
String path = uri.getPath();
return path == null ? C.TYPE_OTHER : inferContentType(path);
return path == null ? C.CONTENT_TYPE_OTHER : inferContentType(path);
}

private int inferContentType(String fileName) {
fileName = Ascii.toLowerCase(fileName);
if (fileName.endsWith(".mpd")) {
return C.TYPE_DASH;
return C.CONTENT_TYPE_DASH;
} else if (fileName.endsWith(".m3u8")) {
return C.TYPE_HLS;
return C.CONTENT_TYPE_HLS;
} else if (fileName.endsWith(".ism") || fileName.endsWith(".isml")
|| fileName.endsWith(".ism/manifest") || fileName.endsWith(".isml/manifest")) {
return C.TYPE_SS;
return C.CONTENT_TYPE_SS;
} else {
return C.TYPE_OTHER;
return C.CONTENT_TYPE_OTHER;
}
}

Expand Down
Loading