Android Support Library with nVidia AndroidWorks

时间:2015-07-28 23:33:04

标签: android nvidia tegra

On the feature list for Android Works (https://developer.nvidia.com/AndroidWorks), the Android Support Library is included. however, I cannot figure out how to link it. Most likely, I need to put com.android.support:appcompat-v7:22.2.1 or something similar somewhere in Visual Studio's build settings. I know that it is not linked because

import android.support.v7.app.ActionBarActivity; 

fails with "package does not exist."

1 个答案:

答案 0 :(得分:0)

I was able to figure it out.

Create the following file: C:\ProjectName\ProjectName\nsight_tegra_build_overrides.xml

<?xml version="1.0" encoding="utf-8"?>

<project name="ProjectName" Basedir="C:\ProjectName\ProjectName\">
    <property name="android.library.reference.1" value = "../../NVPACK/android-sdk-windows/extras/android/support/v7/appcompat"  />
</project> 

The overrides file adds this line to nsight_tegra_build.xml when it is generated. The path for android.library.reference.1 must be a relative path. See How to define v7 appcompat dependency correctly?. Run:

c:\NVPACK\apache-ant-1.8.2\bin>android update project -p c:\NVPACK\android-sdk-windows\extras\android\support\v7\appcompat\

Change target=android-19 to target=android-21 in C:\NVPACK\android-sdk-windows\extras\android\support\v7\appcompat\project.properties. After that, it should be buildable from within Visual Studio.