cancel
Showing results for 
Search instead for 
Did you mean: 

Build with Android Studio got error: package com.oculus.vrappframework does not exist

KouTsuneka
Explorer
I got this error when trying to build any project in Android Studio (Mobile SDK 1.0.4).  It works with 1.0.3. Please help me.
Grade 2.10
com.android.tools.build:gradle:1.5.0
NDK r12b
Android Studio 2.2.2
jdk1.8.0_91
Executing tasks: [:VrSamples:Native:Naly:Projects:Android:generateDebugSources, :VrSamples:Native:Naly:Projects:Android:mockableAndroidJar, :VrSamples:Native:Naly:Projects:Android:prepareDebugUnitTestDependencies, :VrSamples:Native:Naly:Projects:Android:generateDebugAndroidTestSources, :VrSamples:Native:Naly:Projects:Android:compileDebugSources, :VrSamples:Native:Naly:Projects:Android:compileDebugUnitTestSources, :VrSamples:Native:Naly:Projects:Android:compileDebugAndroidTestSources]

Configuration on demand is an incubating feature.
:VrSamples:Native:Naly:Projects:Android:preBuild UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:preDebugBuild UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:checkDebugManifest
:VrSamples:Native:Naly:Projects:Android:prepareDebugDependencies
:VrSamples:Native:Naly:Projects:Android:compileDebugAidl UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:compileDebugRenderscript UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:generateDebugBuildConfig UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:generateDebugAssets UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:mergeDebugAssets UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:generateDebugResValues UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:generateDebugResources UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:mergeDebugResources UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:processDebugManifest UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:processDebugResources UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:generateDebugSources UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:mockableAndroidJar UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:preDebugUnitTestBuild UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:prepareDebugUnitTestDependencies
:VrSamples:Native:Naly:Projects:Android:preDebugAndroidTestBuild UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:prepareDebugAndroidTestDependencies
:VrSamples:Native:Naly:Projects:Android:compileDebugAndroidTestAidl UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:processDebugAndroidTestManifest UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:compileDebugAndroidTestRenderscript UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:generateDebugAndroidTestBuildConfig UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:generateDebugAndroidTestAssets UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:mergeDebugAndroidTestAssets UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:generateDebugAndroidTestResValues UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:generateDebugAndroidTestResources UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:mergeDebugAndroidTestResources UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:processDebugAndroidTestResources UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:generateDebugAndroidTestSources UP-TO-DATE
:VrSamples:Native:Naly:Projects:Android:compileDebugJavaWithJavac
F:\Oculus\VrSamples\Native\Naly\java\com\KouTsuneka\naly\MainActivity.java:17: error: package com.oculus.vrappframework does not exist
import com.oculus.vrappframework.VrActivity;
^
F:\Oculus\VrSamples\Native\Naly\java\com\KouTsuneka\naly\MainActivity.java:19: error: cannot find symbol
public class MainActivity extends VrActivity {
^
symbol: class VrActivity
F:\Oculus\VrSamples\Native\Naly\java\com\KouTsuneka\naly\MainActivity.java:28: error: cannot find symbol
public static native long nativeSetAppInterface( VrActivity act, String fromPackageNameString, String commandString, String uriString );
^
symbol: class VrActivity
location: class MainActivity
F:\Oculus\VrSamples\Native\Naly\java\com\KouTsuneka\naly\MainActivity.java:30: error: method does not override or implement a method from a supertype
@Override
^
F:\Oculus\VrSamples\Native\Naly\java\com\KouTsuneka\naly\MainActivity.java:32: error: cannot find symbol
super.onCreate(savedInstanceState);
^
symbol: variable super
location: class MainActivity
F:\Oculus\VrSamples\Native\Naly\java\com\KouTsuneka\naly\MainActivity.java:34: error: cannot find symbol
Intent intent = getIntent();
^
symbol: method getIntent()
location: class MainActivity
F:\Oculus\VrSamples\Native\Naly\java\com\KouTsuneka\naly\MainActivity.java:35: error: cannot find symbol
String commandString = VrActivity.getCommandStringFromIntent( intent );
^
symbol: variable VrActivity
location: class MainActivity
F:\Oculus\VrSamples\Native\Naly\java\com\KouTsuneka\naly\MainActivity.java:36: error: cannot find symbol
String fromPackageNameString = VrActivity.getPackageStringFromIntent( intent );
^
symbol: variable VrActivity
location: class MainActivity
F:\Oculus\VrSamples\Native\Naly\java\com\KouTsuneka\naly\MainActivity.java:37: error: cannot find symbol
String uriString = VrActivity.getUriStringFromIntent( intent );
^
symbol: variable VrActivity
location: class MainActivity
F:\Oculus\VrSamples\Native\Naly\java\com\KouTsuneka\naly\MainActivity.java:39: error: cannot find symbol
setAppPtr( nativeSetAppInterface( this, fromPackageNameString, commandString, uriString ) );
^
symbol: method setAppPtr(long)
location: class MainActivity
10 errors

FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':VrSamples:Native:Naly:Projects:Android:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.952 secs


1 ACCEPTED SOLUTION

Accepted Solutions

KouTsuneka
Explorer
The problem is in  this line (in any AndroidPrebuilt\jni\Android.mk)
LOCAL_SRC_FILES := ../../../Libs/Android/$(TARGET_ARCH_ABI)/$(BUILDTYPE)/libvrappframework.a

variable $(BUILDTYPE) return empty so gradle cound't find c++ static library

and this condition statement here hide "path not found" error message
ifneq (,$(wildcard $(LOCAL_PATH)/$(LOCAL_SRC_FILES)))
include $(PREBUILT_STATIC_LIBRARY)
endif

workaround by hard code your build type 
LOCAL_SRC_FILES := ../../../Libs/Android/$(TARGET_ARCH_ABI)/Debug/libvrappframework.a

another same problem missing java library
// add this line (correspond with library AndroidPrebuilt/build.gradle - VrApi doesn't have this)
artifacts.add('default', file("../../Libs/Android/aar/Debug/VrGUI.aar"))

View solution in original post

8 REPLIES 8

xieqiupeng
Honored Guest
Oh, I have the same question, someone can help?

9reyson
Honored Guest
 I have the same question...Have you solve the problem?

tomiko-suzuki
Explorer
 I have the same question.

tomiko-suzuki
Explorer
I have the same question. VrAppFramework.jar is not generated.

vladdonets
Honored Guest
The same problem here!  😕

KouTsuneka
Explorer
The problem is in  this line (in any AndroidPrebuilt\jni\Android.mk)
LOCAL_SRC_FILES := ../../../Libs/Android/$(TARGET_ARCH_ABI)/$(BUILDTYPE)/libvrappframework.a

variable $(BUILDTYPE) return empty so gradle cound't find c++ static library

and this condition statement here hide "path not found" error message
ifneq (,$(wildcard $(LOCAL_PATH)/$(LOCAL_SRC_FILES)))
include $(PREBUILT_STATIC_LIBRARY)
endif

workaround by hard code your build type 
LOCAL_SRC_FILES := ../../../Libs/Android/$(TARGET_ARCH_ABI)/Debug/libvrappframework.a

another same problem missing java library
// add this line (correspond with library AndroidPrebuilt/build.gradle - VrApi doesn't have this)
artifacts.add('default', file("../../Libs/Android/aar/Debug/VrGUI.aar"))

mirantt
Honored Guest
I have the same problem. But when I try to build project using "Build.bat" file, it works perfectly. Can anyone help us to resolve the above issue?

Mitnainartinari
Protege
Have you made sure your app has access to VrAppFramework.aar? There is no VrAppFramework.jar in mobile 1.0.4 (just the aar). For my project, I copied VrAppFramework.aar to my projects app/libs directory. In my project's build.gradle I have:

allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
}
In my module's build.gradle I have:

dependencies {
    ....
compile(name: 'VrAppFramework', ext: 'aar')
}