Dart SDK version error when getting dependencies - intellij-idea

I'm trying to add the http and image Dart packages. After adding the dependencies in pubspec.yaml and attempt to "Get dependencies", I'm getting the version error.
I have attempted "Check for Update" in IntelliJ, reinstall Flutter and Dart plug in in IntelliJ, redownload Flutter, and ran "flutter upgrade" in Flutter Console, with no luck. It seems the Dart SDK that comes with Flutter has not been updated.
I was able to download later version of Dart SDK independently, but if I just drop the dart-sdk folder of a newer version into the Flutter folder, I get more error still.
How can I update the Dart SDK in the Flutter package, so I can add dependencies?

The reason was flutter console being in the beta channel, causing flutter to not upgrade to latest version. Fix was flutter channel dev then flutter upgrade in console.

Related

Implicit PendingIntent Vulnerability error from Google Play Store

Problem Describe:
Recently, some developers have reported that they want to update their app(s) on Play Store,
However, it receives rejection from Google with the title Implicit PendingIntent Vulnerability, said that their app(s) contain an Implicit PendingIntent issue. And they need to fix this issue before the deadlines shown in their Play Console, or app(s) may be removed from Google Play.
Similar Question: Google denied update due Remediation for Implicit PendingIntent Vulnerability
As#tao mentioned, let me post the solution here.
Problem Reason:
HMS Core Push kit earlier than 5.3.0.304 version、Analytics Kit earlier than 6.0.0.301 version and Account kit earlier than 5.3.0.305 version contain the Implicit PendingIntent issue.
Solution:
Push Kit SDK version 5.3.0.304、Analytics Kit SDK version 6.0.0.301 and
Account kit SDK version 5.3.0.305 have been released and fixed the Implicit PendingIntent issue. They've been tested and verified by developers and can be approved by Google for release.
If you are currently using the plug-in(such as React Native, Cordova, Ionic,Flutter), Before the new version of those plug-in released, Huawei also provide a workaround solution(By manually changing the version number).
The following describes the modification method (based on the 5.x plug-in):
React Native:
After the HMS Core plug-in is installed in the RN, the plug-in package is stored in node_modules/#hmscore.
You need to modify the build.gradle file in the node_modules/#hmscore/react-native-hms-account/android directory (taking the Account Kit plug-in as an example):
Open the build.gradle file and change the SDK version in dependencies.
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.facebook.react:react-native:+' // From node_modules
implementation 'com.huawei.hms:hwid:5.0.3.302'
}
After the update, run the following command to start compilation again. The plug-in downloads the new SDK:
react-native run-android
Cordova/Ionic
If you have installed the plugin as Huawei document describred, the plugin should be saved in node_modules/#hmscore folder.
You need to modify the plugin.xml file in the node_modules/#hmscore/cordova-plugin-hms-push directory. (The following uses the Push Kit plug-in as an example)
Open the Plugin.xml file, search for the keyword framework, and find the SDK to be modified.
<framework src="androidx.core:core:1.3.1"/>
<framework src="com.facebook.fresco:fresco:2.2.0"/>
<framework src="com.huawei.hms:push:5.0.2.301" />
<framework src="resources/plugin.gradle" custom="true" type="gradleReference"/>
Change the version number to the new one and save it.
Go back to the application root directory and delete the platforms/android and plugins/cordova-plugin-hms-push folder.
Run the following command in the root directory:
Cordova:
cordova platform add android
cordova run android --device
Ionic(Cordova):
ionic cordova platform add android
ionic build
ionic cordova run android --device
Ionic (Capacitor) operates in different ways:
①. Delete the capacitor-cordova-android-plugins folder from the android directory.
②. Modify the plugin.xml file according to the description in step 2.
③. Run the following command:
ionic build
npx cap sync
npx cap open android
④. Recompile in the Android Studio
Flutter
You may refer to this answer.
Summary
The plug-ins above are used in open source mode, so developers can modify them directly.
However, the Xamarin plug-in is published in Nuget Package mode. Therefore, you cannot modify the SDK version. If this problem occurs, please feel free to contact us.

Ionic Capacitor Barcode Scanner

I'm building android app using ionic4 and capacitor. I intent to use phonegap-plugin-barcodescanner in my app. But after installing that plugins, I began to fail building my apk. The hint I get from my Android Studio IDE is, that my app gradle using 'com.android.support:appcompat-v7:28.0.0', and the cordova gradle using "com.android.support:support-v4:27.+". I've tried to edit the cordova gradle to v4:28.0.0 (In Android Studio IDE), but still not working. What should I do?
My stack is:
node.js 6.4.1
ionic 4.12.0
angular 7.3.9
capacitor 1.0
and plugins phonegap-plugin-barcodescanner ^8.1.0
Could you show us the build.gradle files entirely?
I installed the plug-in on my project with Capacitor, and there was no problem.
Remove the plug-in, and do these steps :
npm install phonegap-plugin-barcodescanner
npm install #ionic-native/barcode-scanner
ionic cap sync
from https://ionicframework.com/docs/native/barcode-scanner
I was dealing with issues using android and not androidX, so I did then :
Refactor --> Migrate to AndroidX --> No Backup --> Do Refactor
Then do Build --> Rebuild Project
This worked for me

How to use titanium inspector using titanium 5.2.2?

I am using Appcelerator titanium CLI to build ios app. I want to debug the app With Chrome DevTools but it seems like it's not compatible with the version which I have installed currently.
As per ti-inspector documentation, I have installed the node package by the below command.
npm install -g ti-inspector
So, When I tried this into my titanium project directory I am getting this response which is unexpected.
tn-inspector
Unexpected error: undefined
NOTE: titanium version - 5.2.2
Useful GitHub link: https://github.com/omorandi/TiInspector
Need help to understand or mitigate this issue. Thanks in advance!!!.
That repo is 5 years old and might not be compatible with the current SDK. You can use this instruction: https://docs.axway.com/bundle/Appcelerator_Studio_allOS_en/page/debugging_android_apps_with_3rd-party_tools.html to use the internal dev tools connection.

No option for adding New flutter Web Project in IntelliJ Dart Templates !!! Also tried Vs code, is asking for Which Dart template

I'm trying to start a new Flutter project in Intellij as well as Vs code.
Intellij there is no option provided to add a new flutter web project in Dart templates.
Vs code whenever I select New flutter Web Project after accepting the stagehand it asks for the Dart template which is why I'm stuck.??
Please help soon??
Since flutter 1.9 flutter_web is merged inside flutter, Follow the below steps to create and run your first flutter web App through IntelliJ IDEA.
Create a new flutter project.
Now change your flutter channel to master using flutter channel master
Upgrade flutter flutter upgrade
Install the flutter_web build tools flutter pub global activate webdev
Enable flutter web using flutter config --enable-web
Check available devices flutter devices and you will get a result like:
Chrome • chrome • web-javascript • Google Chrome 81.0.4044.92
Web Server • web-server • web-javascript • Flutter Tools
Inside your flutter project create myapp using flutter create myapp
Navigate inside myapp using cd myapp
Finally, run flutter run -d chrome
And you will be able to run your flutter web app into chrome. Hurray 🤟🏽🤟🏽🥳
Reference links: Building a web application with Flutter , flutter_web
It seems that the support for Flutter Web Apps was dropped in stagehand (that contains the dart templates). From this commit on github: (Dropping Flutter Web sample). Instead, this wikipage shows how to migrate/create a web package in flutter from command line.
Create your project from command-line.
Check out this tutorial. flutter.dev/docs/get-started/web
Then just open the project in IntelliJ IDE.
Install or Update the dart and flutter plugins in Intellij and/or VS Code
For Intellij
Go to [mac] Preferences>Plugins>Marketplace and search for Dart and Flutter, install it.
For VS Code
Go to View > Command Pallet and type in Extensions: Install Extensions
then type flutter and install it
Its well documented in this link
Setup Flutter

Camera and Geolocation plugin issue with cordova android 6.3.0

I'm facing a issue after upgrading cordova android project to version 6.3.0 in using Camera and Geolocation plugin. These both plugin uses Permission helper class which requires cordova-plugin-compat. But with cordova android version 6.3.0 release cordova-plugin-compat is no longer supported (
https://cordova.apache.org/news/2017/09/22/plugins-release.html) as it is included in the core. But I'm getting error on resolving org.apache.cordova.PermissionHelper and in org.apache.cordova.BuildHelper . How to solve this issue.
Update cordova-plugin-compat to v1.2, which contains a restriction preventing the plugin files being deployed to cordova-android#6.3.0+:
cordova plugin rm cordova-plugin-compat --force
&& cordova plugin add cordova-plugin-compat#1.2