Skip to content

Commit

Permalink
fix: unknown frames in Rust backtrace
Browse files Browse the repository at this point in the history
- doNotStrip
- proper debug flag application on alvr_client_lib
- extratNativeLibs
  • Loading branch information
ShootingKing-AM committed Aug 20, 2023
1 parent 3180940 commit 29d3d49
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
33 changes: 30 additions & 3 deletions code/mobile/android/PhoneVR/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.android.build.gradle.internal.dsl.PackagingOptions

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
Expand All @@ -10,6 +12,8 @@ def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

def defaultALVRFlavour = "--release"

android {
signingConfigs {
releaseconfig {
Expand All @@ -20,14 +24,14 @@ android {
storePassword "test1234"
keyAlias "PhoneVRKeyPR"
keyPassword "test1234"
println "Configuring releaseconfigs for testing a PR..."
println "[PVR] Configuring releaseconfigs for testing a PR..."
}
else {
storeFile file(keystoreProperties['storeFile'])
storePassword System.getenv("Store")
keyAlias keystoreProperties['keyAlias']
keyPassword System.getenv("Key")
println "Configuring releaseconfigs for release (push) (not a PR)"
println "[PVR] Configuring releaseconfigs for release (push) (not a PR)"
}
}
}
Expand Down Expand Up @@ -75,6 +79,7 @@ android {
cppFlags += "-D_DEBUG=1"
}
}
defaultALVRFlavour = ""
}
}
buildFeatures {
Expand Down Expand Up @@ -111,6 +116,23 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}

packagingOptions {
gradle.startParameter.getTaskNames().each { task ->
println("[PVR] task is " + task)
if (task.contains('debug') || task.contains('Debug')) {
def android = project.extensions.findByName("android")

if(android != null) {
PackagingOptions packagingOptions = android["packagingOptions"]

if (packagingOptions != null) {
packagingOptions.doNotStrip = [ "**/*.so" ]
}
}
}
}
}
}

dependencies {
Expand Down Expand Up @@ -161,13 +183,18 @@ task extractNdk(type: Copy) {

task deleteNdk(type: Delete) {
delete "libraries/"
delete "../ALVR/build/"
delete "../ALVR/target/"
}

task buildClientLib {
doLast {
exec {
workingDir '../ALVR'
commandLine 'cargo', 'xtask', 'build-client-lib', '--release', '--no-stdcpp'
if(defaultALVRFlavour.length() > 0)
commandLine 'cargo', 'xtask', 'build-client-lib', '--no-stdcpp', defaultALVRFlavour
else
commandLine 'cargo', 'xtask', 'build-client-lib', '--no-stdcpp'
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="viritualisres.phonevr">

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Expand Down Expand Up @@ -41,7 +43,9 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:replace="android:extractNativeLibs"
android:extractNativeLibs="true">
<activity
android:name=".InitActivity"
android:label="@string/app_name"
Expand Down

0 comments on commit 29d3d49

Please sign in to comment.