Is there a way to check if a particular flutter plugin will work with a particular Android/IOS operating version? - flutter

I'd like to know if there is a way to determine if a flutter plugin will operate on a particular Android or IOS operating version?
For example would a flutter plugin like:
https://pub.dev/packages/http/
Work on android version 6 and older?
I expect that it would be dependent on the version of the plugin I'm intending to use.
Is there an easy way to check this?

You can view build.gralde file for check minimum Android version and plugin_name.podspec file (where plugin_name is name of the plugin) for minimum iOS requirements. Many plugins on pub.dev contains links to its source code (on GitHub or etc.)).
build.gradle contains in android folder, and you need to find line like this:
defaultConfig {
minSdkVersion 21
}
plugin_name.podspec file contains in ios folder, you need to find like this:
s.platform = :ios, '9.0'
Config files also contains more information about what version of Language plugin using.

Related

Cannot resolve symbol after upgrading Flutter

After upgrading to latest flutter (2.10.2), there are errors on build.gradle in both my own project and other packages.
Error: Cannot resolve symbol 'Properties'
def localProperties = new Properties()
Error: Cannot resolve symbol 'FileNotFoundException'
if (flutterRoot == null) {
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
How should I modify the issues, and should I modify even if it is not in my own project?
Edit: Based on #Jai Techie comment, I tried to check the Project SDK and it was set to No SDK. I have a lot of options:
Android API 27 Platform java version "1.8.0_242"
Android API 28 Platform version 11.0.11
Android API 29 Platform java version "1.8.0_242"
Android API 30 Platform java version "1.8.0_242"
11 version 11.0.11
Android Studio java home version 11.0.11
Embedded JDK version 11.0.11
I tried to select the Android API 30 because it seems the latest one (I based only using the number) but it still has the same issues. I tried to change to 11 version and the issues now are gone. So now I'm not sure if what I'm doing is correct. Any comments? Thanks!
Edit:
I found this so I guess 11 was the latest on my case. https://developer.android.com/studio/releases/platforms
Can you do one thing if u r using widnows then pleas follow this :
First go inside where your flutter sdk is save
in your system clear cache and then go to bin directory of flutter sdk and
copy path,
Go inside enviornment var in your system and new path and paste bin path of
your flutter sdk
Then go inside terminal try to run flutter clean .
For fixing 'cannot resolve symbol "Properties"|"GradleException"'
in the android/app/build.gradle file:
In Android Studio go to Project Structure and there:
Project Settings->Project->Project SDK: make sure that it's set to latest platform.
Project Settings->Modules->Module SDK: make sure that both are set to latest platform.
Replace the GradleException() with FileNotFoundException()

How to use a specific version of flutter for build apk, when i have 2 version of flutter install?

So i am installing both version of flutter, version 2 and, 1.22.6 , i want to build apk for my 1.22.6 project, but flutter automatically call the version 2 for building apk, this create error, what should i do?
Try using this Flutter version manager
You can create alias for Flutter and point to different version
for example
flutter will call flutter 1.22.6
flutterd will call flutter 2 instead
so when you want to build for 1.22.6 just use flutter
I have write a article, sadly in Thai not translate yet, how to have 2 different version of Flutter and how to make alias to call different version here
https://medium.com/kbtg-life/%E0%B8%A3%E0%B8%B9%E0%B9%89%E0%B8%88%E0%B8%B1%E0%B8%81-flutter-2-0-%E0%B8%81%E0%B8%B1%E0%B8%99%E0%B8%A3%E0%B8%B6%E0%B8%A2%E0%B8%B1%E0%B8%87-%E0%B9%81%E0%B8%A5%E0%B9%89%E0%B8%A7%E0%B8%97%E0%B8%B3%E0%B8%A2%E0%B8%B1%E0%B8%87%E0%B9%84%E0%B8%87%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%A3%E0%B8%B2%E0%B8%A1%E0%B8%B5%E0%B8%97%E0%B8%B1%E0%B9%89%E0%B8%87-2-%E0%B9%80%E0%B8%A7%E0%B8%AD%E0%B8%A3%E0%B9%8C%E0%B8%8A%E0%B8%B1%E0%B8%99-de861c810d57?source=your_stories_page-------------------------------------
so after you this, you can just run
flutter build
I also faced same problem in the past. So what I did was, I downloaded both versions of flutter say (flutter2.2 and flutter1.22). And I have kept them in same folder. Now if I want to use flutter 2.2 then I'll rename "flutter2.2" folder to "flutter" and If I want to use flutter1.2 then I'll rename the "flutter1.2" folder to "flutter"
In the environment variable path I have set the path to "flutter/bin" so if I rename flutter2.2 to flutter then my environment variable will automatically take 2.2 version.
You may need to restart your PC after changing the version.
The simple way is:
Download the version of Flutter you need and put it in the place where Flutter is installed
In this directory you have "flutter" folder.
In Ubuntu, it is usually located in this path:
/home/username/development/flutter
To develop the software with the desired version, just change the desired folder name to "flutter".
For example :
flutter --> flutter-2.x.x
flutter-3.x.x ---> flutter

Where is the version specified in Ionic app?

I'm using AppVersion.getVersionNumber() to get the version number of my Ionic app. But where does this number come from?
The problem is that when I run the app on a smartphone through devapp, I get a different version number depending on what OS I have…
iOS (on an iPhone 6): 1.0.2
Android (on a Samsung S10): 1.0.4
Searching around for "version" in my source code, I find this in config.xml (in the root):
<widget version="1.0.3" … >
I don't know if this is relevant, but it is the currently delivered version of the app.
I'm using Ionic 4.10.0
AppVersion cordova plugin reads the app details from the native code of the application.
So the version values that you see, are configured in the native IDE's.
Check these files in your respective platform folders..
ios/App/App.xcodeproj/project.pbxproj the key to look for in this MARKETING_VERSION
android/app/build.gradle the key to look for in this versionName

Can my Flutter project have a different version number for Android and iOS?

Is it possible to use pubspec and the flutter build tools to create release versions of my app with a different version for each platform? Eg iOS could be 1.0.1+10 and Android 5.2.3?
This is wrong but I'm thinking something like like the below
name: myapp
description: my app description
ios_version: 1.0.1+10
android_version: 5.2.3
Currently the apps in the stores have different version numbers. Would we need to bump them both to the same version, say 6.0.0? Is it possible to have a pubspec for each version?
For iOS find the file name Generated.xcconfig and change the following parameter
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
Otherwise, default version getting from pubspec.yaml from the following line :
version: 1.0.0+1 // default version set
For Andriod edit the local.properties file inside android folder when you are building.
For iOS edit the Generated.xcconfig file inside ios/FLutter folder or update from Xcode when you are building.
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1

How to import iOS native framework into Flutter?

I want to contribute in this Flutter_blue plugin project adding the functionalities for native iOS using Objective C framework CoreBluetooth. How do I import the framework in to the library so I can start using its APIs?
Update:
CoreBluetooth is not suitable for Flutter project, because it's not a cocoapod dependency. So what I did what, go to cocopods website and look for other bluetooth dependencies from there. You can also find instructions of how to install a dependency there. For me, I made added pod <depdencyname> to <plugin-project>/example/ios/Podfile in the plugin project. Then added dependency: <dependencyname> to the in <plugin-project>/ios/pubspec
I had the same problem for a few time and found a solution by adding this lines to your podspec file at your iOS/ folder in your plugin dir:
s.preserve_paths = 'yourframework.framework'
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework yourframework' }
s.vendored_frameworks = 'yourframework.framework'
Then, on your Flutter project, in the iOS folder, just run pod update on terminal so it can fetch the new dependencies.
You can find the full issue open by me with this problem here.
If you're looking to add a CocoaPod dependency to the iOS "half" of a Flutter plugin, I believe the correct way to do so is to update the podspec file in the /ios folder of the plugin source. I recently did some work on the AdMob plugin, for example, and its podspec lists the SDKs for Firebase and Google Mobile Ads:
https://github.com/flutter/plugins/blob/master/packages/firebase_admob/ios/firebase_admob.podspec
And that's how they get included in the build.