content of Android res folder is not found at project build

Hi, I am using Visual Studio 2010 + NVIDIA CodeWorksfor Android 1R4 and trying to build android (with ndk part) project.

  1. My application’s Java part has own build.gradle files but as I can see in build log below, Visual Studio uses own build.gradle file? namely:
1>  Projects loaded. Root project using build file 'C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\nsight_tegra_build.gradle'

is it correct that my existing build.gradle files located in the application’s folder are never used and Visual Studiо + Tegra generates its own nsight_tegra_build.gradle file and always uses only this one?

  1. second: I get the following errors which show that builder cannot find /res files specified in AndroidManifest.xml:
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\manifests\full\debug\AndroidManifest.xml:18: error: Error: No resource found that matches the given name (at 'icon' with value '@mipmap/ic_launcher').
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\manifests\full\debug\AndroidManifest.xml:18: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name').
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\manifests\full\debug\AndroidManifest.xml:18: error: Error: No resource found that matches the given name (at 'theme' with value '@style/AppTheme').
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\manifests\full\debug\AndroidManifest.xml:24: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name').
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\manifests\full\debug\AndroidManifest.xml:24: error: Error: No resource found that matches the given name (at 'theme' with value '@style/AppTheme.NoActionBar').
1>  
1>  :processDebugResources FAILED

all res files are in place and present.

How can I set the path to /res folder for Gradle builder?

Please check my question to see if it helps:
https://devtalk.nvidia.com/default/topic/952171/nsight-tegra-visual-studio-edition/is-it-possible-to-move-the-location-of-quot-res-quot-/

“res” has to be in the same directory as the VS project file.

Zingam, let me check this. But can you also comment of 1st part of the ticket? Just to have better understanding how gradle building works here.

Zingam, now VisualStudio finds res folder but it doesn’t find content inside that. My new error is:

1>  command: C:\NVPACK\android-sdk-windows\build-tools3.0.2\aapt.exe package -f --no-crunch -I C:\NVPACK\android-sdk-windows\platforms\android-23\android.jar -M C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug -A C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\assets\debug -m -J C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\generated\source\r\debug -F C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package peerf.jnizeromqsample -0 apk
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug\values\values.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug\values\values.xml:23: error: Error: No resource found that matches the given name: attr 'colorAccent'.
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug\values\values.xml:21: error: Error: No resource found that matches the given name: attr 'colorPrimary'.
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug\values\values.xml:22: error: Error: No resource found that matches the given name: attr 'colorPrimaryDark'.
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug\values\values.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'ThemeOverlay.AppCompat.Dark.ActionBar'.
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug\values\values.xml:27: error: Error: No resource found that matches the given name: attr 'windowActionBar'.
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug\values\values.xml:28: error: Error: No resource found that matches the given name: attr 'windowNoTitle'.
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug\values-v21\values.xml:6: error: Error: No resource found that matches the given name: attr 'windowActionBar'.
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug\values-v21\values.xml:7: error: Error: No resource found that matches the given name: attr 'windowNoTitle'.
1>  
1>  C:\Users\User\Git\zmq_SDK\android_zmq\Peerf_zmq\ARM-Android-NVIDIA\Debug\build\intermediates\res\debug\values\values.xml:30: error: Error retrieving parent for item: No resource found that matches the given name 'ThemeOverlay.AppCompat.Light'.
1>  
1>  :processDebugResources FAILED

all these “not found” attributes are actually located inside the file of res/ folder which I have copied to the my VS2010 project directory. so what should I do else to make these attributes/files readable?

Just to make sure:

MyApp/
|--------MyApp.sln
|--------MyApp/
         |--------MyApp.vcxproj
         |--------res/ <--- your resources

Hi, no, my structure is different as all visual studio project files are in same directory with java and native code folders, namely:

MySolutionName/       <- actually it is  Git_Branch_name
 |---------------------MySolutionName.sln
 |---------------------MySolutionName.vcxproj
 |---------------------MySolutionName.rc
 |---------------------ARM-Android-NVIDIA/
 |---------------------Debug/
 |---------------------jniZMQ/     <- C++ native code for app sdk, compiled ok
 |---------------------res/        <- res folder , which I copied here per your instructions
 |---------------------jniZeroMQSampe/  <- java Android app code
                       |------Gradle/
                       |------app/      <- android java application code
                             |------src/             <- java sources
                             |------build.gradle     <- original gradle config

What should I change in my structure to make it work?

You can set the Gradle at project property Pages: Gradle Build>Gradle Build Root Path.
You override gradle config. see the content of nsight_tegra_build.gradle

if (new File("D:\\VSProject\\Android7\\Android7\\nsight_tegra_build_overrides.gradle").exists()) {
    apply from: "D:\\VSProject\\Android7\\Android7\\nsight_tegra_build_overrides.gradle"
}

if (new File("D:\\VSProject\\Android7\\Android7\\nsight_tegra_build_overrides_debug.gradle").exists()) {
    apply from: "D:\\VSProject\\Android7\\Android7\\nsight_tegra_build_overrides_debug.gradle"

Victor

Victor, just to make sure I understood it correctly:

  1. If I have in my Project’s properties GradleBuildRootPath = $(ProjectDir) Doeas it mean that VisualStudio IDE is trying to find my build.gradle file ONLY in the directory where MyProjectName.vcxproj file located. And it doesn’t look for other build.gradle files in the app’s folder tree at all, correct? What does this settings affect on?

  2. If I place own build.gradle file in the root location above, them my build.gradle will override settings made in IDE, correct?

  3. If I want to use IDE to set gradle.build parameters…Then where in VisualStudio IDE Project’s properties can I set the following Gradle build parameters:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.1.0'
    compile 'com.android.support:design:22.2.0'
}
  1. and If I point to use my own build.gradle file, then where I should put res/ directory with all resource subfolders? in the same place as .vcxproj file or same as build.gradle file?

  2. If I create own nsight_tegra_build_overrides.gradle file . Will it override only parameters it has or overrides \ replace the whole nsight_tegra_build.gradle file?

EDIT: I have just succeeded in compiling the solution with creating my own nsight_tegra_build_overrides.gradle file, but still want to have the points above answered for better understanding of building logic.

Thank you, Nikolay
PS: Maybe I missed that , but can you point me to the documentation’s section where I can get more details on the configuration settings logic.

Hi Nikolay,
Your understanding is right about the above 5 points. if you meet any new issue, Please come to post your new issues.

Victor