I have this problem. Plz let me know how to solve this problem..
I got this git code from a lesson made about 2years ago.
Also different errors showed up when I made a flutter project using git code.
-> This is the problem
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
If you are here because of the flutter 2.10, do this:
Change this:
<application
android:icon="#mipmap/ic_launcher"
android:name="io.flutter.app.FlutterApplication"
android:label="PassesBox"
...
To this:
<application
android:icon="#mipmap/ic_launcher"
android:name="${applicationName}"
android:label="PassesBox"
...
If the application is very old, you should consult the migration guide that the documentation or fial offers you, just like the other answers recommend.
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
but if you still have the deprecated application warnning try the following
step one: delete the cache. flutter clean
step two: remove the pubspec.lock file from the root of the project. rm pubspec.lock
step three: update the libraries if you have any very outdated, you can do it manually or through the command. flutter pub upgrade --major-versions (this command will update all the libraries you have, be careful, before evaluating if such an update is necessary in your project).
then you must make some changes at the android folder level
change the gradle.zip in android/gradle/wrapper/gradle-wrapper.properties to a newer version like:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
and in android/build.gradle update the version to
classpath 'com.android.tools.build:gradle:7.1.2'
the kotlin version in : ext.kotlin_version = '1.6.10'
and if you were using code obfuscation with proguard-rules.pro
remove any added configurations that reference that file in android/app/build.gradle and you should be left with just this
buildTypes {
release {
signingConfig signingConfigs.release
}
}
finally close the code editor or the IDE you use
and in console run flutter pub get and run your project flutter run
Last but not least, do not forget to update the build version of your application to API 33 or higher and have your android studio updated (VERY IMPORTANT FOR UPDATE, )
android-studio
This has been answered before here on SO.
Here:
Your Flutter application is created using an older version of the Android embedding
And here: How to Fix Flutter Warning: Your Flutter application is created using an older version
You can also look at the source of how to migrate here:
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
Related
Hi guys I recently upgraded flutter to 3.0.5 and android studio to chipmunk I went to load an old project in the emulator and recieved this message
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:
C:\Users\PCPERFECT\StudioProjects\Bingo\bingo\android\app\src\main\AndroidManifest.xml uses android:name="io.flutter.app.FlutterApplication"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Build failed due to use of deprecated Android v1 embedding.
When I click the link to get the migration steps I get a 404 page not found can someone lead me to a usefull guide.
Thamks
To remove this problem just follow my steps:
Step1: Open Main Activity of Android (JAVA/Kotlin)
Replace the main activity with this line of code
import io.flutter.embedding.android.FlutterActivity;
class MainActivity: FlutterActivity() {
}
Step 2: Open AndroidManifest.xml
Make these changes
replace this:-
android:name="${applicationName}"
and after that you might need to upgrade your compileSdkVersion 31,
then flutter clean, flutter pub Get, flutter Pub upgrade
RUN THE PROGRAM
After upgrading to Flutter 2.10, I get the following error:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:
/android/app/src/main/AndroidManifest.xml uses `android:name="io.flutter.app.FutterApplication"`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
I've already upgraded to Flutter embedding 2. How to solve this error?
I was able to solve this by setting android:name to
android:name="${applicationName}" in android/app/src/main/AndroidManifest.xml:
<application
android:name="${applicationName}"
Apparently Flutter 2.10 has stricter checks than previous versions.
complete guideline please click
open your AndroidManifest.xml just remove this lineandroid:name="io.flutter.app.FlutterApplication"
there is two solutions
first solution, you can replace
android:name="io.flutter.app.FutterApplication"
with
android:name="${applicationName}"
the second solution, remove
android:name="io.flutter.app.FutterApplication"
and run your code
may be you are working on an old version of Flutter so you faced this problem and maybe you'll face another problems so let's discuss them
1- in this path
{App Dir}\android\app\src\main\AndroidMainfest.xml
you'll find attribute android:name the problem is in its value so we should change it
android:name="io.flutter.app.FlutterApplication"
convert it to =>
android:name="${applicationName}"
2- in this path
{App Dir}\android\build.gradle
you will find this line ext.kotlin_version = 'XXXXXX'
so you should update it to the latest version of kotlin
you can find it here
so latest version for me in 06 JULY 2022 is 1.7.0
i put it in my project and it was ext.kotlin_version = '1.7.0'
i hope that i helped you
The plugins advance_pdf_viewer, flutter_webview_plugin use a deprecated version of the Android embedding.
To avoid unexpected runtime failures or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of
Flutter will remove these deprecated APIs."
I follow some documentation but is still not working.
i upgrade and downgrade my version but still not working.
should I share my mainActivity.kt and manifest file?
if there is no newer version of advance_pdf_viewer, flutter_webview_plugin available with the new android V2 embedding, your can't do anything inside of your app. Keep watching for plugin updates of these 2 plugins... or go to it's github project and open an issue to fix it. Sometime the master branch has already fix it. In this case you could try to link direct to the master branch and not to a version in pub.dev
for advance_pdf_viewer i use $flutter pub add advance_pdf_viewer
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):
dependencies:
advance_pdf_viewer: ^2.0.1
Alternatively, your editor might support or flutter pub get. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:advance_pdf_viewer/advance_pdf_viewer.dart';
and for webview I try dependencies:
flutter_webview_plugin:
git: https://github.com/nuc134r/flutter_webview_plugin.git
and it all works for me than you.
I wanted to run a background process in flutter.I used the code in https://pub.dev/packages/workmanager#-example-tab- and added the dependency required in pubspec.yaml file.
But I am getting "The built failed likely due to AndroidX incompatibilities in a plugin".The detail of the which I am sharing in the screenshot below(2 images):
I tried checking my gradle.properties file as suggested in some posts.But useAndroidX,enableJetifier were set "true".The details of gradle.properties is below:
android.useAndroidX=true
android.enableJetifier=true
This is my flutter doctor -v details:
The flutter build --verbose
I recently got this error, while using cloud_firestore plugin.
Since, Starting from Flutter v1.12.13, new projects created with flutter use AndroidX by default, therefore that didn't solve my problem.
After several times doing Pub get with any versions of plugin,
I figured all you have to do is:
• Go to android/app/build.gradle of your Flutter project, and
• Set minSdkVersion 21
Now, on running flutter build apk, the error should go away.
you just need to migrate to AndroidX maybe
https://flutter.dev/docs/development/androidx-migration
refer this link, please
I'm running a dart only test in intellij and receiving the following error:
The pubspec.lock file has changed since the .dart_tool/package_config.json file was generated, please run "pub get" again.
I have tried pub get a number of times. Any ideas? I'm on the dev branch of Flutter (anything using Dart 2.7 pretty much fails with the same or a similar error message).
Edit
I think that if you have a path reference dependency in the pubspec.yaml file it will fail.
Anything like the following fails with the above message if you try to run a dart test in IntelliJ.
dependencies:
test_dependency:
path: ../test_dependency
I'm not suggesting this is a fix for everyone, but it did resolve my particular situation.
Just ran into this error after upgrading flutter from 1.22.6 to 2.0.2 and trying to use build_runner: ^1.12.2 and json_serializable: ^4.1.0 to generate json serialization/deserialization classes & methods.
The problem is apparently related to the pub package when used with relative paths for packages as noted in the following github issues:
https://github.com/dart-lang/pub/issues/2806
https://github.com/dart-lang/pub/pull/2830
One of the commenters in issue 2806 mentioned running flutter create . inside the flutter project folder which rebuilds .dart_tool/package_config.json, adding any missing entries, solving the problem.
No one solved this problem so far?
I've found a staightforward solution and it works fine for me.
You need to close your IDE (VSCode in my case), make sure that is completely closed using process-monitor.
Then open a terminal window manualy in your project folder and run "flutter pub get"
After that just start your IDE normaly and ewerything will work fine.