Incorrect selection of kernel headers: expected 4.9.x, got 4.6.x with BR 2022.02 and bootlin toolchain from menuconfig - buildroot

I wanted to try out the bootlin toolchain support in buildroot, because now I can simply select them in menuconfig.
BR version: branch 2022.02
Defconfig: atmel_sama5d3_xplained_defconfig
Toolchain: `Toolchain -> Toolchain (Bootlin toolchains)"
"Bootlin toolchain variant": armv7-eabihf glibc stable 2021.11-1
On a clean git checkout, after loading and modifying the above defconfig via menuconfig, the build stops with:
Incorrect selection of kernel headers: expected 4.9.x, got 4.6.x
The expectation (autogenerated by helper script gen-bootlin-toolchains) seems to be ok, because the release announcement also mentions 4.9 for stable toolchain versions.
Any idea what goes wrong here? Or how buildroot calculates the "got" version? (I don't see any downloaded files in output/build/toolchain-external-bootlin-2021.11-1 other then the stamp files and the file-list files)
If I download the file manually and check arm-buildroot-linux-gnueabihf/sysroot/usr/include/linux/version.h, the version is indeed 4.9
I could just manually download the toolchain and specify the parameters manually, but then the bootlin integration (which is nice) doesn't make sense.

The root cause for this mis-match was that the bootlin toolchain won't be downloaded by buildroot automatically, but is expected in the PATH as arm-linux-gcc. I did have arm-linux-gcc in my PATH but linked to another toolchain.
After manually installing (download+extract) the bootlin toolchain and adding the "bin" folder of the toolchain to the PATH of the environment in which buildroot was run, the build succeeded as expected.

Related

Could not open settings generic class cache for settings file Flutter

When I clone the project from GitHub and execute the program it throws this error
Please help all thanks
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 61
"Unsupported class file major version 61" indicates java 17, which is used by Gradle.
https://stackabuse.com/bytes/fix-java-error-unsupported-class-file-major-version-63/
This indicates major class version and corresponding Java versions.
https://docs.gradle.org/7.3/release-notes.html
Per this link, Java 17 support was added circa Gradle 7.3, so either upgrade to a more recent version of Gradle, or change your settings to use an earlier version of Java (such as JAVA_HOME if using the CLI).
If you run flutter doctor, you probably will see:
[!] Android Studio (version 2022.1)
✗ Unable to find bundled Java version.
https://github.com/flutter/flutter/issues/118502 seems to be the latest issue in which this crops up. https://github.com/flutter/flutter/issues/106674 notes they reverted a buggy change, but it hasn't hit stable yet, so you'll have to symlink the bundled JRE folder as a workaround til the next AS update.
e.g. for mac, you can use:
cd /Applications/AndroidStudio.app/Contents
ln -s jbr jre

Unity 2022.1.20f1 Fresh Install - Missing NDK for Android

I have re-installed Unity 2022.1.20f1 after I did an update.
However, I can no longer compile and Android Project for the Quest 2.
It reports Android NDK not found or invalid. Please, fix it in Edit/Unit->Preferences->External Tools.
Here it tells me I am missing the Android NDK with a fixed path of
C:\Program Files\Unity\Hub\Editor\2022.1.20f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
And as you can see from the image below, There is no NDK folder.
I have re-installed it twice.
I installed another version of the Editor and the NDK folder does exist in it's respective location.
I have tried to use the NDK for the working Version but it reports anything other than 21.3.6528147 are not officially supported.
I am at my wits end and wondered if anybody else has had this issue?
Many thanks
Mark
Hello you need to install the android NDK separatly and then provide the new NDK folder path in the setting of Unity as well as the SDK of android folder path as well. You have 2 methodes to do so 1 : to just install install android studio with all the stuff I mentioned or 2: just install them one by one from the website NDK Installation
SDK Installation

Trying to build a cmake project by vscode but failed in cmake configuration [duplicate]

Windows 10, CMake 3.19.1
Im trying to compile test project with XC8 compiler, CMake and custom toolchain (third party).
Link: Toolchain repository
Toolchains quick guide says to only add two strings at top of my CMakeLists.txt.
So ive got the next CMakeLists.txt:
project(Test)
# set up the Microchip cross toolchain
set(CMAKE_TOOLCHAIN_FILE ./external/cmake-microchip/toolchain.cmake)
# set the default MCU model
set(MICROCHIP_MCU PIC18F97J60)
add_executable(main main.c)
But occasionaly, every time CMake generation output starts with:
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.28.29333.0
-- The CXX compiler identification is MSVC 19.28.29333.0
..... more
And i havent any Makefile in the output folder.
Also im try to run CMake with -G "Unix makefiles". And makefile been generated, with wrong output and any trace of custom toolchain use.
Output been:
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Detecting C compiler ABI info
Every CMake generation try, im cleanup the output folder.
Why custom toolchain doesnt starts?
The variable CMAKE_TOOLCHAIN_FILE should be set before the first project() call:
cmake_minimum_required(VERSION <..>)
# set up the Microchip cross toolchain
set(CMAKE_TOOLCHAIN_FILE ./external/cmake-microchip/toolchain.cmake)
project(Test)
# set the default MCU model
set(MICROCHIP_MCU PIC18F97J60)
add_executable(main main.c)
When first project() call is processed, CMake automatically calls the script specified in CMAKE_TOOLCHAIN_FILE.
Note, that preferred way is to not hardcode path to the toolchain in the CMakeLists.txt but pass -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain option to the cmake.

Visual Studio in OSX: Installing Android SDK Platform-Tools v26.0.0 failed

I'm trying to compile to Android using Unity3D. The normal procedure is installing Android Studio. However I want to use Visual Studio Community (Preferences -> SDK Locations -> Android) to avoid downloading Android Studio because I do not plan to use it:
The rest of components seems to be installed well. However the Android SDK Platform-Tools installation outputs the following error:
Installing Android SDK Platform-Tools v26.0.0 failed
Could not find a
part of the path
"/Users/username/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/package.xml".
I have been able to install it after creating an empty folder named platform-tools manually. Unfortunately it seems it has not been installed correctly because the folder only contains one file named: package.xml of much less than 7 Mb. Unity also output the following error:
Android SDK is outdated
SDK Tools version 0.0.0 < 24.0.0.
Workarounds seem easy (both can be downloaded from here: https://developer.android.com/studio/index.html):
Install Android Studio: it seems the easier and quick way, but >500Mb HardDisk space
Install only command line tools: not so easy and quick
However I guess I'm very stubborn and curious: why could it be failing?
Hey mate for me it worked to create the missing folder manually.
So this folder:
/Users/username/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/
Is actually missing so if you do this:
$ cd /Users/username/Library/Developer/Xamarin/android-sdk-macosx/
$ mkdir platform-tools
And try to run the installer from VS UI
it should install the platform-tools package.
Complement from #benjamingranados:
Also check that the destiny folder in the "Locations" Tab is the same.

Android studio:import NDK project from eclipse

I exported project from Eclipse(windows) and imported it to android studio V 0.4.2(ubuntu).
The project include working NDK library.
I get this error when try to run my app:
Execution failed for task ':app:compileDebugNdk'.
NDK not configured
From others stackoverflow posts, I understand that it is an issue.
But get no workaround for this.
Should i proceed the development with eclipse for now, or is that the a lazy option ?
EDIT :
I run this command:
export NDK=~/Downloads/android-ndk-r9c
and then :
and then go to my app directory and run this:
ndk-build
And i get this:
yarinkos-u#yarinkosu-MSI-Notebook-EX600:~/AndroidStudioProjects/AndEngineEXperimental$ ndk-build
/home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: 1: /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: dirname: not found
/home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: 132: /home/yarinkos-u/Downloads/android-ndk-r9c/ndk-build: uname: not found
ERROR: Unknown host operating system:
What i did wrong?
It seems that the script running,but i miss something there.
EDIT 2:
i mistakenly runing this also :
export PATH=~/Downloads/android-ndk-r9c
so i get the error above.
If i running onlt this :
export NDK=~/Downloads/android-ndk-r9c
I get ndk-build not found error.
NDK Support is introduced from Android Studio 0.4.1 only, so make sure you are running AS 0.4.1 or above.
Android gradle plugin must be 0.7.+ in build.gradle file and also new NDK integration requires NDK r9c .
Lines from Developer tools blog under Release 0.4.1
Supports importing NDK projects. If the imported project contains NDK
sources, these are imported into the jni/ source set of the project,
the module name is inferred from the Makefile and stored in the Gradle
file, and the ndk.dir property is defined in local.properties.
Check more about it here :
http://tools.android.com/recent
you need to download the NDK for your operatings system # https://developer.android.com/tools/sdk/ndk/index.html once it's downloaded, install it it'll extract the contents to the correct file system it needs to be in it'll take some time, also make sure you are running the latest android studio. it worked for me. good luck.