Package android.media.tv.tuner is not found in android.jar file - android-studio

From this documentation We can see many "android.media.tv.tuner" package reference.
From the SDK source code provided by SDK Manager (in AppData\Local\Android\Sdk\sources\android-30\android for example), this package is indeed present.
But from the android.jar in my Android Studio project, There is no reference to this package at all.
Why this module is not built by default ?
How can I create/configure an android TV project with this tuner module ?
To get around this problem, I try to build myself the android.jar file, but the soong_build command fails :
$ soong_build -b out/soong -l Android.bp -o Android.ninja Android.bp
panic: Found two Blueprint files in directory . : Copyright (C) 2016 The Android Open Source Project and .

All components inside "android.media.tv.tuner" package are tagged as #SystemAPI or #Hides. So these cannot be visible from SDK.

Related

Android studio is giving the following error when I am trying to build a ionic project "Gradle sync failed: Sync failed: reason unknown"

I am trying to build a ionic project in Android studio on Ubuntu 20.04 . I am using the command ionic capacitor build then android studio opens up as expected then it shows this error Gradle sync failed: Sync failed: reason unknown. I am unable find a solution for this particular gradle sync error. I have reinstalled Ubuntu and other things but still the problem persists.
In my case, a fresh install of Android Studio resulted in Android 31 being the only SDK available but the project was targeting Android 30. I went to Tools > SDK Manager and made sure the appropriate version of Android SDK was installed and available. After restarting, and allowing the gradle sync to complete I was able to build/run the app on a virtual device, etc.
Here is what I found
This is the screenshot thanks for helping.
Capacitor lets you manage your own Android project. Like any IDE-backed project, sometimes things get so out of sync that the only solution is to rebuild the project.
To do this, follow these steps:
Copy any source code you created (such as Java files in app/android/src, manifest files, or resource files) into a safe location outside of app/android.
Next, make sure you are running an updated version of the Capacitor CLI:
npm install #capacitor/cli#latest
Remove the android directory:
rm -rf android/
Re-create the Android app from Capacitor:
npx cap add android
Copy your saved source files back into the project.
Check the error log. You should find something like "Module: 'mobile' platform 'android-30' not found" or something similar. Click Tools > SDK Manager and download the appropriate Android SDK Platform package.
on top right you will see option to view log file upon clicking there you will redirect to file manager and open idea file there
example :
open idea file and scroll down you will see actual issue.
In my case android sdk 31 was not installed.
I installed android sdk 31 from File>Settings>Apprearance and behaviour>system settings>android sdk and install required android sdk and rebuild the project.
accord to my observation in most cases you get this error because you have not required sdk installed in your system.

CMake - How can I pass the windows SDK version to an ExternalProject built with msbuild?

I have a CMake project which has an external dependency (Crypto++). The external project has a vcxproj file provided, so in order to add it to the build process, I added it like this:
ExternalProject_Add(CryptoPP
SOURCE_DIR ${CRYPTOPP_SRC_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND "${MSBUILD_EXE}"
"/p:OutDir=<BINARY_DIR>/bin/$<CONFIG>/"
"/p:IntDir=<BINARY_DIR>/obj/$<CONFIG>/"
"/p:Configuration=$<CONFIG>"
"/p:Platform=${CMAKE_VS_PLATFORM_NAME}"
"<SOURCE_DIR>/${CRYPTOPP_PROJECT}"
INSTALL_COMMAND "${CMAKE_COMMAND}" -E make_directory <INSTALL_DIR>/lib
COMMAND "${CMAKE_COMMAND}" -E copy <BINARY_DIR>/bin/$<CONFIG>/cryptlib${CMAKE_STATIC_LIBRARY_SUFFIX} <INSTALL_DIR>/lib
)
This worked fine until I started using Windows 10. Now I'm getting this error: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".
I tried passing the SDK version from CMake, using the only related CMake variable I could find, by adding this flag to msbuild:
"/p:WindowsTargetPlatformVersion=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}"
However, I'm still getting the same error. I tried displaying the value of the CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION variable, and it always seems empty.
Modifying the dependency vcxproj is not an option. I don't know in advance what SDK version whoever needs to build the project has installed, so that's not an option.
I can't find any way to obtain and pass the SDK version to the external project build, what am I doing wrong?
I found the problem. I forgot to set the platform toolset. I was building my CMake project with v100 so it doesn't need an SDK version. Because I didn't configure the platform toolset for the external project, it used the one set in the project which was the latest (v141) which needed an SDK version.
So adding this flag fixed my setup:
"/p:PlatformToolset=${CMAKE_VS_PLATFORM_TOOLSET}"

Android Studio Error Communicating With System CMake

I just created a trivial Android project with C++ support using Android Studio 3.0.1 on OS X High Sierra and I'm trying to figure out how to get CMake support.
I wasn't able to install CMake through Android Studio because there's an error with the project and the Tools > Android option is not available through the menu.
Here's what the project looks like:
For comparison, here's another trivial project without C++ support showing the Tools > Android option.
I read something about configuring Android Studio to use the system cmake. Apparently, you can override the cmake.dir setting in the project's local.properties file:
https://developer.android.com/studio/projects/add-native-code.html
excerpt:
Include the path to the CMake installation in your project's
local.properties file: cmake.dir="path-to-cmake"
So, I set the cmake.dir to /usr/local (because I already installed cmake previously through homebrew and changed the properties file)
It now reads (replacing ~ with your home directory)
# ... some comments warning you not to modify
# the properties file ...
ndk.dir=~/Library/Android/sdk/ndk-bundle
sdk.dir=~/Library/Android/sdk
cmake.dir="/usr/local"
Android Studio now shows the error message (newlines and \s inserted for legibility and home directory replaced with ~):
Error:Error occurred while communicating with CMake server.
Check log
~/AndroidStudioProjects/Cpptest/
\ app/.externalNativeBuild/cmake/
\ debug/armeabi-v7a/cmake_server_log.txt
for additional information.
However, the contents of that file suggest that the cmake binary did something reasonable in response to a command invoked by Android Studio.
CMAKE SERVER:-
CMAKE SERVER: [== "CMake Server" ==[
CMAKE SERVER: {"supportedProtocolVersions":[{"isExperimental":true,"major":1,"minor":1}],"type":"hello"}
CMAKE SERVER: ]== "CMake Server" ==]
The system CMake is version 3.10.0 which is greater than 3.7 (I believe the minimum supported version).
How do I "convince" Android Studio to use the system CMake?
Is there a way to install a CMake distribution managed by the IDE if Tools > Android is not available?
If neither of those options seems straightforward, can I configure Android Studio to use a different build system for the C++ sources, like GNU Make or just plain gradle?
So, I still don't know why pointing Android Studio at the system CMake didn't work. I also tried installing a "full CMake" distribution through their website (https://cmake.org/download/) and pointing to /Applications/CMake.app/Contents/
However, it is possible to install CMake and lldb in a different way in Android Studio on OS X even if Tools > Android Does not appear.
And that is:
Preferences > Appearance & Behavior > System Settings > Android SDK > SDK Tools
Or, equivalently, Cmd , and then type sdk in the search field and then click the SDK Tools tab.
Here's a picture.
There was an issue in earlier versions of external CMake support where we didn't support future CMake server protocol versions. This has since been fixed. If you try a recent Android Studio 3.1 I think it should work.

fatal error: QCAR/QCAR.h: No such file or directory

I want to run a Vuforia sample project, in android studio.
Android NDK is ready to use and i can build NDK samples.
Vuforia Image Target sample app is imported and Vuforia.Jar library added as dependency.
But when i build the project, i see this:
fatal error: QCAR/QCAR.h: No such file or directory
Can anyone help me? Why this error appears?
Make sure the installation location of Vuforia SDK is correct.
From the official website of Vuforia:
https://developer.vuforia.com/library/articles/Solution/Installing-the-Vuforia-Android-SDK
The Vuforia SDK is distributed as a ZIP package for the following
platforms: Windows, Mac OS X, and Linux.
To start developing with the Vuforia SDK:
Download the Vuforia SDK (you need to accept the license agreement before the download can start)
Extract the contents of the ZIP package and put it into
Adjust the Vuforia Environment settings in Eclipse
Once extracted, the SDK package reveals a directory structure in your
Android development environment. This structure ensures that sample
apps can be easily built and deployed using the Android NDK and the
Eclipse Java developer environment.

Grabble project sync failed

I have installed Android Studio. When I launch the program, there is the following error.
"Failed to find: com.android.support:appcompat-v7:10.+"
I have checked the SDK manager, Android Support Library and Android are installed.
Maybe my question appears to be stupid but I didn't find any answer.
[EDIT] I changed the
com.android.support:appcompat-v7:10.+
to:
compile 'com.android.support:appcompat-v7:21.0.2'
Now I have more than 400 lines of not found files:
http://pastebin.com/Sa4scRH1
In you build.gradle you have in the dependency section a line containing this string:
compile 'com.android.support:appcompat-v7:10.+'
replace it with this one:
compile 'com.android.support:appcompat-v7:21.0.2'
You are using there a quite old version of the compat library just use the newest one v21.0.2. If this still fails install the support repository from the SDK Manager.

Resources