Error: The specified language version is too high. The highest supported language version is 2.8. in android studio how can I fix it? - android-studio

After switched to branch 'stable' flutter channel
The following is the build issue.
Error: The specified language version is too high. The highest supported language version is 2.8.
output: ../../third_party/dart/third_party/pkg/collection/lib/src/utils.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.8.
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
^
../../third_party/dart/third_party/pkg/collection/lib/src/wrappers.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.8.
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
^
../../third_party/dart/third_party/pkg/collection/lib/src/functions.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.8.
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
^

Why?
This happens, because the your specified language version is higher than the one declared in the .dart_tool directory (specifically in the package_config.json file).
Solution
You can either delete the folder manually or let Flutter tools do it for you. Run flutter clean from the terminal or, if using Android Studio, go to Tools -> Flutter -> Flutter Clean.

Cause
One of your packages in pubspec.yaml is requiring dart version up that you have installed. For example, I face this issue withe analyzer package.
In my pubspec
analyzer: ˆ3.3.1
So I ve run
flutter version
Answer
Tools • Dart 2.13.3
But as you can see here version 3.3.1 require Dart Tools 2.14
Solution
Discover which package version in incompatible with your dart

Run flutter clean and then flutter --version command from the terminal:
Then, check the flutter version
in pubspec.yml (here it is 1.22.5) and change the version to match the one from the terminal.

If the above do not work for you, simply update all your packages to the latest package, flutter clean, pub get and run the project.

I had the same error yesterday and I fixed it.
This error came when you switch the version of flutter from 1.17.5 (stable channel) to 1.20.? (dev channel).
To fix it, just create a new project using the last version installed on your PC and copy & paste all the files.
The problem comes from the pubspec.lock file because of the versions.
So in conclusion, if you changed the version of Flutter, just create another project and copy the necessary files.

Related

Error being thrown when trying to debug from JetBrains Rider: error HE0004: Could not load the framework 'DVTITunesSoftwareServiceFoundation'

I am unable to debug a Xamarin.iOS application out of JetBrains Rider 2022.2.2. This is the error that gets thrown when trying to deploy to the simulator:
error HE0004: Could not load the framework 'DVTITunesSoftwareServiceFoundation' (path: /Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/DVTITunesSoftwareServiceFoundation):
dlopen(/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/DVTITunesSoftwareServiceFoundation, 0x0001): Library not loaded: '#rpath/ContentDelivery.framework/Versions/A/ContentDelivery'
Referenced from: '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/DVTITunesSoftwareServiceFoundation'
Reason: tried: '/usr/lib/swift/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/lib/mlaunch/mlaunch.app/Contents/MacOS/../Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/usr/lib/swift/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/lib/mlaunch/mlaunch.app/Contents/MacOS/../Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/System/Library/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file)
I had the same problem.
Let me guess... You just upgraded to XCode14 and the corresponding Command Line Tools?
Downgrading XCode and Command Line Tools to 13.4.1 helped me.
What worked for me
Go To https://developer.apple.com/download/all/?q=command%20line%20tools
Download XCode and Command Line Tools for Xcode 13.4. Unpack Xcode (13.4.1) and rename it (for example Xcode 13) and place it parallel to Xcode (14) in the programfolder.
.
Then install the Command Line Tool.
Now in Xcode (still 14) > Preferences > Location > Command Line Tools, select version 13.4.1 instead of 14. You can see the Path for it is "Application/Xcode 13".
For safety restart tools, and it worked again...
Update: With the last update of Visual Studio, the downgrade was no longer necessary for me. Since then I can build the apps with XCode 14 and the corresponding command line tools without any problems. So I suggest upgrading Visual Studio to the latest version first.
Here is how I made it work:
Download the former version here (note: you need a developer account)
Double-click on the downloaded .xip file to install XCode 13.4.1
Rename the newly installed XCode application into Xcode.13.4.1.app and move it into your Applications folder
Open the usual XCode application and go to the preferences
In the locations tab you will be able to select XCode 13.4.1 for Command Line Tools
Redownload Visual Studio?
It turns out Microsoft released a brand new Visual Studio at some point.
We haven't been in our Xamarin project for a while and even though it said there were no updates, no Simulators were showing up.
Our Visual Studio said the version was 8.10.25 yet when I was reading the release notes, they referred to version 17.3.7.
Our team had to download Visual Studio again and then we saw the version updated to 17.3.7.
So check your version of Visual Studio and redownload the newest one. That's what fixed this issue for us.
Latest update fixed the issue for me.
I had the same issue, while searching for answer I found this thread,
writing this to confirm that I took the latest update on 9th nov(NET 7 SDK). Issue seems resolved with latest update.
There is a more elegant solution to this problem. You need to upgrade Xamarin.iOS manually. The releases are on GitHub 16.0.0.72 did the trick for me.

which cmake will Android plugin use?

With Android Studio 3.3 I use native (C++) library, which I built with CMake. The Android plugin (v. 3.2.1) will choose the 'builtin' or 'external' cmake, depending on the configuration of externalNativeBuild, as documented at developer.android.com.
I want to add an extra custom task (install) that should use the same cmake version as the Android Plugin. But even with the 'builtin' cmake, it's not clear what the path is. I can find android.sdkDirectory, but even there I have today sdk\cmake\3.6.4111459 and sdk\cmake\3.10.2.4988404, and for some strange reason, some of my projects choose 3.6, while others use 3.10. This contradicts the official the release notes for Android Studio that "Gradle still uses version 3.6.0 by default", but well…
How can I decide which to use, without reimplementing the Android Plugin's obscure logic?
One workaround that may help, parse the first line of the generated file .externalNativeBuild/cmake/debug/armeabi-v7a/cmake_build_command.txt:
Executable : C:\local\Android\sdk\cmake\3.10.2.4988404\bin\cmake.exe
This still needs some adjustments, because the later versions of build tools will use .cxx instead of .externalNativeBuild; the build variant names may be different too.
Android Studio will pick up the latest CMake version under sdk\cmake, but you can configure your particular version from
externalNativeBuild {
cmake {
...
version "cmake-version"
}
}
And specify our custom CMake director as below inside local.properties
cmake.dir="path-to-cmake"
Or, you can choose NOT to upgrade your CMake from SDK Manager (just to delete the sdk\cmake\<version to delete> folder will be fine) so that you can stick to the CMake version your project is comfortable with.

Where is gradle build tools version set?

I have installed sdk build tools version 28.0.2, and set buildToolsVersion = "28.0.2" in build.gradle. Yet when I run ./gradlew installDebug, I get an error message saying The SDK Build Tools revision (23.0.1) is too low for project.
I even UNinstalled version 23.01.1 via the android studio sdk manager - but then when I run gradlew it reinstalled it!
I ran grep -ri buildtool * to try and find where it might be, but the only reference I could find was in build.grade.
I managed to work around this by upgrading my gradle version to 3.1.0. But as a result, I now get this message:
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.0.
Which tells me that the SDK Build Tools version is being set... somewhere!
Where else is the required build tools version set? How do I change it so that gradle will use the latest version, rather than being stuck on an old one?
I had the same problem. The buildtoolsversion is defined in build.gradle(Module.app).
I removed this line from the file and then the warning disappeared.

How can I update com.android.support:exifinterface version

Currently I am using Android Studio 2.3.3. I wanted to update the support library version from 25.3.1 to 26.0.1. So inside my build.gradle file I did all the necessery changes and changed all the support library versions from 25.3.1 to 26.0.1. After that when I synced the project it shows me an error(I have given a screenshot) in compile 'com.android.support:appcompat-v7:26.0.1
All com.android.support libraries must use the exact same version...Found versions 26.0.1,25.3.1.Examples include com.android.support:animated-vector-drawable:26.0.1 and com.android.support:exifinterface:25.3.1
The error screen
My question is that where can I find com.android.support:exifinterface to update
I tried the same in Android Studio 3.0.0. That showed the same error
Try this:~
compile 'com.android.support:design:26.0.0-alpha1'

Apportable is not updated to the latest version

I am using the free version of the apportable, after updating the apporatable it is showing the current version is "Apportable SDK version release_1.0.34 (1e06..... full)" although on
their website it is showing the latest version is 1.1.08.1, how to get the latest SDK?
Last update output in terminal:
$ apportable --version
Apportable SDK version release_1.0.34 (1e06ded3379bd59161534f679b9bcc3e385b1d95 full)
clang version 7fc8b05e4f57f61dbbbe5c8e62581b0e0c42941e
gdb version b5f29d65da6903ad0570d0c4a887c513367d2778
android sdk version r21.0.1.1
android ndk version r8d.1
ninja version 315d897710c6ca6e7df7d3b0bf68879356841c5d
In Terminal, enter:
apportable update
and
apportable update_toolchain
This will check for updates and update apportable itself, as well as updating the Android toolchain / SDK stuff. Usually just updating apportable suffices.
If Apportable won't update you can "reset" it by deleting the folder ~/User/.apportable. In Terminal:
rm -rf ~/User/.apportable
Then go to the apportable website, download apportable and follow their instructions for first-time setup.
Note that there is a chance that the Starter version may simply lag some version numbers behind the paid versions. I'm not aware of Apportable's versioning strategy but many companies only provide major or critical updates to free editions of their product, they prefer the free version to be stable rather than the latest edition.
You also need to ensure that you have the latest SDK version selected on your Account page in the SDK Version section.
I was experiencing the same problem; for some reason an SDK several versions behind was selected on this page.

Resources