Quest APK v2 signature

I’m having so much trouble… days of spinning without success so far and I feel like I’m going crazy.

I have a successful APK build. I generated a keystore and used it to get the APK built (it wouldn’t build for distribution without it)… But my apk isn’t signed and Oculus won’t accept unsigned apks. I can manually sign it using jarsigner but that’s only for v1 signatures. I need a v2 signature. I have NO idea how to get Android Studio to sign my packaged APK v2.

  • I open it up in Android Studio “profile/debug apk”
  • Build / Generate Signed Bundle or APK
  • APK
  • Module is the apk I opened, keystore path is the same keystore i used to build apk (path to UE project Build/Android/Keystore.jks)
    - the next page has NO settings for V1, V2 at the bottom

When I proceed from here I get this error:



Error:Internal error: (java.lang.ClassNotFoundException) com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index
java.lang.ClassNotFoundException: com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.intellij.util.indexing.counters.IndexCounters.<clinit>(IndexCounters.java:34)
at com.intellij.util.indexing.impl.MapReduceIndex.<init>(MapReduceIndex.java:85)
at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex$CompilerMapReduceIndex.<init>(CompilerReferenceIndex.java:232)
at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex.<init>(CompilerReferenceIndex.java:79)
at org.jetbrains.jps.backwardRefs.JavaCompilerBackwardReferenceIndex.<init>(JavaCompilerBackwardReferenceIndex.java:12)
at org.jetbrains.jps.backwardRefs.JavaBackwardReferenceIndexWriter.initialize(JavaBackwardReferenceIndexWriter.java:79)
at org.jetbrains.jps.incremental.java.JavaBuilder.buildStarted(JavaBuilder.java:148)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:363)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:139)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:302)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:135)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:228)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)


Any help would be greatly appreciated.

UPDATE! here’s how I got it to work:

I don’t know if this is documented anywhere but I couldn’t find it and would have appreciated knowing this 2 days ago.

1- Rather than the version of Android Studio recommend in the unreal documentation (3.5.3) I downloaded the latest version (4.1.2)
2 - the Oculus documentation (https://developer.oculus.com/documentation/native/android/mobile-application-signing/) just says “In Android Studio, go to Build > Generate Signed Bundle / APK.” This isn’t clear enough. I had to open Android studio and open>[Unreal Project]>Intermediate>arm64>gradle
3 - when open (mine wouldn’t open in ASv3.5.3), then Build > Generate Signed Bundle / APK
4 - the generated/signed apk was saved in gradle>app>app-release.apk
5 - When I only selected v2 signature Oculus didn’t accept the apk as signed, even though the above docs say selecting just v2 is fine. I had to select both v1 and v2 to get a build that the site accepted.

I hope that helps someone else save some time.

2 Likes