Hi, I am trying to build Android NDK project with Tegra VisualStudio AndroidWorks. Previously I’ve built the project with AndroidStudio using Android.mk and Application.mk scripts
Where in Settings should I put links to these Android.mk and Application.mk files to build the project with Tegra for VS?
Sorry, but I can’t find this path. Please see my Project’s properties tabs.
and second question: am I right that I don’t have to explicitly indicate any paths for locations of c/c++ sources and .so libraries if these files are already were placed within directory with code, I have imported my project from?
Hi Nikolay,
from your the picture, You don’t use template Import an ndk-build Android Project
What I said is for this kind of projects. External Media.
If you just use a normal Nsight Tegra project, which uses MSBuild instead of make, there is no need to set *.mk.
Could you send me the build log and Nsight Tegra log.
Build log: you can set Level to Diagnostic via Tools>options>Projects and Solutions>Build and Run
Nsight Tegra log: you can find it at %APPDATA%\NVIDIA Corporation\Nsight Tegra\Logs
Hi, I set log level to Detailed. Here is error listing in log file (attached)
2017-03-05 23:42:34.6481|ERROR|Nvidia.PentaK.SolutionManager|Failed to failed solution platforms: Empty path name is not legal.
System.ArgumentException: Empty path name is not legal.
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Nvidia.PentaK.Tools.MSBuild.SolutionFile..ctor(String filepath)
at Nvidia.PentaK.SolutionManager.<>c__DisplayClass4_0.<.ctor>b__0()
Please make sure I 'm using Gradle not Ant
By the way, what is the difference of using MSBuild vs. make? What should I changed in project to use that? Remove Android.mk file and МЫ will build all automatically using just Gradle scripts?
Please make sure I 'm using Gradle not Ant
You can use set Android Build system via Project Properties>Configuration Properties>General>Project Defaults>Android Build System.
what is the difference of using MSBuild vs. make?
Night Tegra adapt MSBuild to native code build, MSBuild has good integration with VS IDE, you can change build options at Project Properties.
Android NDK use make as it’s default build system.
They are two independent build system.
What should I changed in project to use that?
You can see the change native build system at Project Properties>Configuration Properties>General>Project Defaults>Configuration Type:
NDK-Build: use make (NDK default way)
External Build: user defined way
Others: Night Tegra’s own build system based on MSBuild.
Remove Android.mk file and МЫ will build all automatically using just Gradle scripts?
There is no magic water, all depends on your configuration. there is no need to Remove android.mk.
It looks that the NdkProjectPath is not correct, but I am sure I indicated a full absolute path to the directory where Android.mk is located (see screenshot).
Hi, the migrating project is large enough, so it’s not possible to share in full. I can share *.sln and *.vcxproj files if it can help? I suggest I could remotely share my PC screen to you at any time just text me at skype-nilyin
I have also added some debug code to add-application.mk and run ndk-build in the directory, which I specified as NDK Project Path:
C:\Users\User\Git\android\AndroidNDK\app\src\main\cpp>ndk-build
Invalid attribute value syntax for android:configchanges: =
“keyboard|keyboardHidden|screenLayout|screenSize|orientation”
android:theme=“@android:style/Theme.Translucent.NoTitleBar”
android:label=“@string/app_name” /
Android NDK: APP_BUILD_SCRIPT: C:/Users/User/Git/android/AndroidNDK/app/src/main/jni/Android.mk
Android NDK: APP_PROJECT_PATH: C:/Users/User/Git/android/AndroidNDK/app/src/main
Android NDK: app build script to search .mk file: C:/Users/User/Git/android/AndroidNDK/app/src/main/jni/Android.mk
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: C:/Users/User/Git/android/AndroidNDK/app/src/main/jni/Android.mk
C:/NVPACK/android-ndk-r12b/build//…/build/core/add-application.mk:208: *** Android NDK: Aborting… . Stop.
why project path is different from what I have set in IDE?
why even if I run ndk-build in cli in the correct folder it doesn’t take settings from Application.mk
No need a full project, just the project file and a few source code that could repro this issue is enough.
why project path is different from what I have set in IDE?
from your attachment pic they are the same C:\Users\User\Git\android\AndroidNDK\app\src\main\cpp.
why even if I run ndk-build in cli in the correct folder it doesn’t take settings from Application.mk?
It seems ndk-build assume Android.mk in /Jni. and there is another invalid attribute value.
Invalid attribute value syntax for android:configchanges: =
“keyboard|keyboardHidden|screenLayout|screenSize|orientation”
android:theme=“@android:style/Theme.Translucent.NoTitleBar”
android:label=“@string/app_name” / Android NDK: APP_BUILD_SCRIPT: C:/Users/User/Git/android/AndroidNDK/app/src/main/jni/Android.mk
Android NDK: APP_PROJECT_PATH: C:/Users/User/Git/android/AndroidNDK/app/src/main
Android NDK: app build script to search .mk file: C:/Users/User/Git/android/AndroidNDK/app/src/main/jni/Android.mk
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: C:/Users/User/Git/android/AndroidNDK/app/src/main/jni/Android.mk
C:/NVPACK/android-ndk-r12b/build//…/build/core/add-application.mk:208: *** Android NDK: Aborting… . Stop.
From your project file and *.mk file, The migrating project is large and has its own some customization building steps.
The better way is to use External build system with it’s existed build system, not to create the Nsight Tegra MSBuild config for each lib and sub-project.
You can add External build system config, write dos batch file to trigger its own build system and then add dos batch file to Build and Rebuild cmd line at Configuration properties>NMake Page.
You can use Nsight Tegra for debugging by set the Configuration Properties>Debugging.