I was trying to run my Flutter app and this shows up:
Compiler message:
lib/main.dart:1:8: Error: Not found: 'dart:html'
import 'dart:html';
^
Invalid depfile: C:\Users\IMBA\AndroidStudioProjects\mi_card_flutter-master\.dart_tool\flutter_build\410385fb4867e1d74565d68665ecb577\kernel_snapshot.d
Invalid depfile: C:\Users\IMBA\AndroidStudioProjects\mi_card_flutter-master\.dart_tool\flutter_build\410385fb4867e1d74565d68665ecb577\kernel_snapshot.d
...
Compiler message:
lib/main.dart:1:8: Error: Not found: 'dart:html'
import 'dart:html';
^
Unhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:dart%3Ahtml; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7)
#1 asFileUri (package:vm/kernel_front_end.dart:567:37)
#2 writeDepfile (package:vm/kernel_front_end.dart:760:21)
<asynchronous suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:536:15)
<asynchronous suspension>
#4 _FlutterFrontendCompiler.compile (package:flutter_frontend_server/server.dart:40:22)
#5 starter (package:flutter_frontend_server/server.dart:178:27)
#6 main (file:///C:/b/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:8:30)
#7 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\IMBA\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 882
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\IMBA\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 16s
Exception: Gradle task assembleDebug failed with exit code 1
And something else showed up after I used the --scan flag in the problem section.
java.lang.ClassNotFoundException: com.google.wireless.android.sdk.stats.IntellijIndexingStats$Index
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.intellij.util.indexing.counters.IndexCounters.<clinit>(IndexCounters.java:34)
at com.intellij.util.indexing.impl.MapReduceIndex.<init>(MapReduceIndex.java:94)
at com.intellij.util.indexing.impl.MapReduceIndex.<init>(MapReduceIndex.java:110)
at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex$CompilerMapReduceIndex.<init>(CompilerReferenceIndex.java:248)
at org.jetbrains.jps.backwardRefs.index.CompilerReferenceIndex.<init>(CompilerReferenceIndex.java:84)
at org.jetbrains.jps.backwardRefs.JavaCompilerBackwardReferenceIndex.<init>(JavaCompilerBackwardReferenceIndex.java:12)
at org.jetbrains.jps.backwardRefs.JavaBackwardReferenceIndexWriter.initialize(JavaBackwardReferenceIndexWriter.java:80)
at org.jetbrains.jps.incremental.java.JavaBuilder.buildStarted(JavaBuilder.java:149)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:359)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:139)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:288)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:121)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:228)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
I took all the material of this Flutter app from the appbrewery Flutter course. This happens when I was trying to make the MIcard project. Any thoughts to solving this problem?
Something that work for me is: Delete your pubspec.lock, and press 'Pub Get' in your pubspec.yaml, it'll regenerate pubspec.lock file again and should fix the problem.
Go to pubspec.yaml file, try doing Packages get | Pub get, and then build the project again.
I faced the same error and further, I tried:
flutter clean
flutter pub get
in the terminal, and the issue solved!
This should work!!!
flutter clean,
flutter pub get,
flutter build appbundle --release --no-tree-shake-icons
Just in case, do this:
IntelliJ/Android Studio: "Edit Configurations" (in your run configurations) → "Additional run args".
VS Code: search for "Flutter run additional args" in your user settings.
Then, add:
--no-sound-null-safety
This fixed the problem for me.
What this basically does is that, if you use an import that doesn't support null safety, Flutter ignores it.
I also tried this, thanks to iapicca
run in your terminal
flutter channel stable
flutter upgrade --force
flutter pub cache repair
next,
cd <YOUR APP FOLDER>
flutter clean
Optimizing imports (Ctrl + Alt + O) in Android Studio solved the issue for me.
This error happens when indentation is not proper in pubspec.yaml file. Make sure font and other dependencies are having right indentation.
Just faced this issue, I solved it by removing an unused import
import 'dart:js';
the issue started when I added it by mistake, took a while to realize it was the issue
delete pubspeck.lock and pub get , didn't solve my problem.
in my case its caused by import 'dart:html';.
VSCode sometimes imports these libs automatically instead of what we
want is import 'dart:io';
Look for in your file which has import 'dart:html'; and delete it. then you can run the app again.
This worked for me.
Deleted build and android/app/build.
this solution work for me :
1 - delete pubspeck.lock
2 - run flutter clean
3 - run flutter pub get
I couldn't build for iOS, so I deleted flutter/bin/cache/artifacts. iOS works well then building Android had the same error. I tried flutter upgrade and that solved the problem.
Removing .gradle folder helped
Gradle is located at
On Windows: %USERPROFILE%\.gradle
On Mac / UNIX: ~/.gradle
Close android studio.
Remove whole .gradle folder.
Open Android studio and build.
Go to the pubspec.yaml file and Download packages
OR
Go to Terminal flutter pub get
Upgrade Flutter flutter upgrade --force
Run Flutter App Press F5 or flutter run
I managed to solve this problem by reading a different topic here: Recompile with Xlint
First, find your build.gradle file from the Android folder (Android/app/build.gradle)
Then paste the following code inside the android brackets {}:
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}}
I have pasted it at the bottom before the end bracket and it worked for me.
After this, just restart your app and it should work.
I found solution update flutter sdk.
flutter channel stable
flutter upgrade --force
Try this, it might work for you
flutter clean,
flutter pub get,
flutter build apk --release --no-tree-shake-icons
If you have flavours then add flavour with the build command.
And update the minimumsdk to a higher version compatible with java version.
Delete pubspec.lock file and then flutter clean and flutter pub get .
This works like a charm.
the packages that you added are not updated . sometimes it is old version . so update the pckages that mentioned under the dependencies in your pubspec file .
I did fix the issue by removing an unused import:
import 'dart:developer';
So I will highly recommand you to remove all unused imports before trying any of the other solutions
please check your asset rooting in pubspec.yaml
assets:
- assets/images/logo.svg
then thats clear
try to
flutter pub get
Related
I am working on an old project. It worked fine before 5 days ago. Now I am facing an error with agora. I didn't any change on my previous code.
here is error-
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':agora_rtc_engine:compileDebugKotlin'.
> Could not resolve all files for configuration ':agora_rtc_engine:debugCompileClasspath'.
> Could not find native-full-sdk-3.4.6.jar (com.github.agorabuilder:native-full-sdk:3.4.6).
Searched in the following locations:
https://www.jitpack.io/com/github/agorabuilder/native-full-sdk/3.4.6/native-full-sdk-3.4.6.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 38s
Running Gradle task 'assembleDebug'... 40.0s
Exception: Gradle task assembleDebug failed with exit code 1
I am using agora_rtc_engine: ^3.3.1 bacause this project developed without null-safety (maybe flutter 1.5). How can I solve this problem ?
1.Run flutter upgrade in the terminal to upgrade Flutter
2.Run dart migrate to run the dart migration tool
3.Solve all errors which the migration tool shows
4.Run flutter pub outdated --mode=null-safety to print all outdated packages
5.Run flutter pub upgrade --null-safety to upgrade all packages automatically
6.Check the code for errors and solve them
7.Run dart migrate again and it should now be successful. Follow the link to checkout the proposed changes
8.Press the "Apply Migration" button
9.Check the code for errors again and fix them.
Run flutter run in the command line and the application should run...
Note: If there are any library in you project that don't support null safety you must need to upgrade that library. if that library don’t have null safety remove the library and use another library
So you have to migrate your project to null-safety first and then get
agora_rtc_engine: ^4.2.2
Then you to to your build.gradle and add that last line
allprojects {
repositories {
google()
jcenter()
// add this line.
maven { url ‘https://www.jitpack.io' }
}
}
Because following this issue here on GitHub there is no solution for it because this issue has been closed on the agora project.
For anyone who is still facing this issue
1: Run flutter pub outdated --mode=null-safety to check which dependencies are outdated
2: Run flutter pub upgrade --null-safety to upgrade all dependencies
3: It would update agora_rtc_engine to latest sdk, try to change that to agora_rtc_engine: 4.2.2
4: Set ext.kotlin_version = '1.6.10' in *build.gradle
Note: If you face any incompatibility with other packages for setting minSdk as 19, change minSdk to 19
5: If you faced any gradle error, you might need to change gradle-wrapper.properties
//add this line
distributionUrl=https://services.gradle.org/distributions/gradle-7.3.1-all.zip
Thats all
I'm currently learning Flutter using Android Studio but I can't figure this issue help pls thank you :(
Compiler message:
../../.pub-cache/hosted/pub.dartlang.org/flutter_chips_input-1.3.1/lib/src/chips_input.dart:42:7:
Error: The non-abstract class 'ChipsInputState' is missing
implementations for these members:
- TextInputClient.connectionClosed Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class ChipsInputState extends State>
^^^^^^^^^^^^^^^ ../../flutter/packages/flutter/lib/src/services/text_input.dart:658:8:
Context: 'TextInputClient.connectionClosed' is defined here. void
connectionClosed();
^^^^^^^^^^^^^^^^ Target kernel_snapshot failed: Exception: Errors during snapshot creation: null build failed.
FAILURE: Build failed with an exception.
Where: Script '/Users/clyde/flutter/packages/flutter_tools/gradle/flutter.gradle'
line: 780
What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/clyde/flutter/bin/flutter'' finished with non-zero exit value 1
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 18s Finished with error: Gradle task assembleDebug
failed with exit code 1
If you are using Flutter Form Builder, you can manually update the flutter_chips_input library to the latest version because the Flutter form builder uses an old version.
This issue was discussed in the Flutter GitHub repository Issues section here.
Adding the below dependency manually to the pubspec.yaml file solved the problem for me:
flutter_chips_input: ^1.9.4
I am guessing you are on dev or master channel (at least that is the cause in my case)...you can switch to beta or stable to get rid of the error:
flutter channel beta|stable
I have also faced the same problem and not sure how that was fixed.
I have tried the following things
Check Flutter Doctor and fix if you have any errors
Try Flutter clean
Delete pubspec.lock file and run flutter pub get or flutter pub upgrade
I Hope, that may help you guys.
What worked for me
Look for packages in your pubspec.yaml file that depend on the chips_input package, e.g. form_builder and make sure it's the latest version.
Upgrade all packages in pubspec.yaml file to be sure.
I've been stack with the same error. I've searched and tried everything and nothing works.
Based on searching, the issues may have been caused by using flutter_form_builder package on an incompatible version of flutter SDK.
What works for me (Windows user):
Tried switching to master|stable version
Deleted all flutter and pub temp directories/folders:
Navigate to C:/Users/(Current User)/AppData/Local/Temp/ and delete all directories/folders having
flutter_tool.xxx, native-platformxxx, and pubxxx
Installed the latest version of Flutter SDK.
https://storage.googleapis.com/flutter_infra/releases/stable/windows/flutter_windows_1.17.3-stable.zip
Tried Flutter clean
Deleted pubspec.lock file and run flutter pub get or flutter pub upgrade
Upon building my project, another issue pop-up, NDK version not found. Instead of downloading the required NDK, I removed/renamed the NDK directory/folder from my Android SDK directory/folder.
Hope this steps helps.
I am working on a react native application. when I try to build the applications using react-native run-android the build fails. Here is the output of the error that occurs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 8s
253 actionable tasks: 5 executed, 248 up-to-date
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: ./gradlew app:installDebug
debug Error: Command failed: ./gradlew app:installDebug
at checkExecSyncError (child_process.js:607:13)
at execFileSync (child_process.js:627:13)
at runOnAllDevices (/Users/FaisalHussain/mobile/node_modules/#react-native-community/cli/build/commands/runAndroid/runOnAllDevices.js:58:39)
at buildAndRun (/Users/FaisalHussain/mobile/node_modules/#react-native-community/cli/build/commands/runAndroid/runAndroid.js:142:41)
at then.result (/Users/FaisalHussain/mobile/node_modules/#react-native-community/cli/build/commands/runAndroid/runAndroid.js:104:12)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
The application was on a old version of react native (0.48.x) I have updated it to 0.59.10.
What I have done so far:
used jetifier to resolve issues with the plugins.
checked that the build tools version matches the compile sdk version
checked if the emulator is running.
Hence I have tried everything I could to resolve this but had no luck. Please do guide me on how to resolve this issue. Looking forward to your answers.
make sure you have followed all the necessary steps from the upgrade helper https://react-native-community.github.io/upgrade-helper/?from=0.48.0&to=0.59.10
also i would suggest you to upgrade to v0.60+ because there are breaking changes after v0.59.10.
having said that
before you run the app make sure your gradle is clean
run the following command to clean your gradle cd android && ./gradle clean
then later you can navigate back to your app folder cd .. and try and run again react-native run-android
Looks like your packages not working stable with Android side. It's better be update all packages and react native version to their last stable versions.
If you face with too much error while update, you can create fresh new react native project (with same package name with your current project), install all packages (and their dependencies) and copy your current project's source code to your new project.
Android in React Native does not allow similar packages to reside in the project.
In my case I had react-native-cookies and #react-native-cookies/cookies packages that add similar code to the Kotlin file upon build. This causes issue of similar imports in java JDK.
I removed one and it worked.
SOLVED at the same issue:
My solution was at /android/build.gradle file.
Somehow, the buildscript versions were wrong.
Follow the exact same step of RN documentation and make a totally new & clean project.
And compate the /android/build.gradle file > buildscript & dependencies part.
There should be some version differences.
It matters by your own local env settings.
After changing buildToolsVersion, ndkVersion, classpath, it worked fine again!!
also, remove duplicated libraries, as #Nimantha said.
I just import webview_flutter plugin and found that the plugin has incompatible with my flutter environment. Then using Android Studio I migrate my AndroidX environment with "Migrate to AndroidX" option.
I want to use webview_flutter plugin for viewing the page. Help appreciated.
Here is the error message
Launching lib/main.dart on Andromax B26D2H in debug mode...
D8: Program type already present: android.support.v4.media.MediaBrowserCompat$ItemCallback
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/22.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/105.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/148.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/133.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/72.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/128.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/79.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/88.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/110.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/67.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/120.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/91.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/102.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/6.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/118.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/5.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/52.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/58.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/43.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/127.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/142.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/151.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/19.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/34.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/46.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/63.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/107.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/9.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/31.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/15.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/115.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/70.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/62.jar,
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.media.MediaBrowserCompat$ItemCallback
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 4m 59s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility for more information on the problem and how to fix it.
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Thanks for your suggestion,
I've fixed it by doing these steps :
1. Try adding this line In your Project folder > android > app > build.gradle, add the following Line in
multiDexEnabled true
inside defaultConfig
Then upgrade gradle dependency in the android/build.gradle file: classpath 'com.android.tools.build:gradle:3.3.1' (previously on version 3.2.1)
Run flutter clean and rebuild your project
First make sure that all your packages in the pubspec.yaml are of the latest version. Then open the android project of your flutter app with android studio, select Refactor->Migrate to Androidx(make sure that you are doing that that from the android project and not from the flutter one). Wait until android studio finishes migrating your project, rebuild your project. Hope it helps!
I found this solution on Github by #tiklupxgit, solved this issue quickly.
Update this line in [Project Directory]/android/build.gradle
classpath 'com.android.tools.build:gradle:3.5.4'
Now run these commands in your terminal under [Project Directory]
flutter clean && flutter pub get
Finally, build your project again.
It seems like you are facing issues with dex and androidX.
Follow https://stackoverflow.com/a/56490440/9236994
this answer to resolve your issue.
Create a new flutter project and move existing code to it: flutter migration
flutter create --androidx -t <project-type> <new-project-path>
eg: flutter create --androidx -t app .
I have tried the best ever possible ways to break it down. I have been trying to use youtube videos from URL using the youtube video flutter plugin and getting androidx incompatibilities plugin error. Finally, I found the result. Just update
the build.Gradle file in android - classpath
'com.android.tools.build:gradle:4.1.0'
gradle-wrapper.properties
distributionUrl=https://services.Gradle.org/distributions/gradle-6.7-all.zip
update the value as above it will work perfect, as for me.
For me, I copied settings.gradle file
to the new file settings_aar.gradle
Then Removed the following code from settings_aar.gradle:
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
Ok I finally solved the problem thanks to #Navpreet Singh
In order to fix the problem of the default grey icon of Firebase FCM (on Xiaomi devices) I added in the Manifest:
From then on, I got this error when building the application:
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Completed 20,2s
The build failed probably because of AndroidX incompatibilities in a plugin. The tool is about to
try to use Jetifier to resolve the incompatibility.
Building the cloud_firestore plugin...
Exception: The cloud_firestore plugin could not be built because of the above problem.
Running the Gradle task 'assembleAarRelease'...
When I commented out the metadata in the Manifest, the program started to compile again.
Just Enable multidex in app/build.gradle file.
defaultConfig {
....
multiDexEnabled true
}
dependencies {
.....
implementation 'com.android.support:multidex:2.0.1'
}
You just only run 'get packages' in your pubspec.yaml and the probles will be solve
you can solve this issue by following these step which is given in this link
https://medium.com/#sahaishashank2507/the-gradle-failure-may-have-been-because-of-androidx-incompatibilities-in-this-flutter-app-39b34acee40e?source=---------2------------------
You need to open your project in the android studio.
select Refactor->Migrate to Androidx(You need to migrate Android Project not
flutter one)
Android Studio finish some process you have to wait for it .
Than rebuild your project and it will work fine.
it can resolve your issue
I've been using the new preview of android studio and really like it. But recently my project won't build. I get the following error:
Gradle:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':TestProj:compileDebug'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
Question is how do I enable the stack trace so I can get to the root of the error. As it is I really have no idea what's causing this.
If you are using the Gradle Wrapper (the recommended option in Android Studio), you enable stacktrace by running gradlew compileDebug --stacktrace from the command line in the root folder of your project (where the gradlew file is).
If you are not using the gradle wrapper, you use gradle compileDebug --stacktrace instead (presumably).
You don't really need to run with --stacktrace though, running gradlew compileDebug by itself, from the command line, should tell you where the error is.
I based this information on this comment:
Android Studio new project can not run, throwing error
Similar to #joe_deniable 's answer the thing I found with my own projects was that gradle would output that kind of error when there was a misconfiguration of my system.
I discovered that by running gradlew installDebug or similar command from the terminal I got better output as to what the real problem was.
e.g. initially it turns out my JAVA_HOME was not setup correctly. Then I discovered it encountered errors because I didn't have a package space setup correctly. Etc.
The only solution I've found is to first create the project in Android Studio, then close the project, then import the project. I searched all over and could not find the root cause and all other solutions people posted didn't work.
OK seems like a caching issue of some sort. There was indeed an error in code with the R.id.some_id not being found but the editor was not picking it up displaying that there were no errors.
I installed Android Studio on an old WinXP with only for me option. After install I did the new project wizard and when opening the new project a got some Gradle error with some failed path to my instalation dir. c:/Document"#¤!"#¤ and settins/...
The I uninstalled and did a new install with option for all users (C:/Programs/..) then I opend the previous created project with no errors.
So it might be a path problem. (Just spent 10 sec debugging, so I might be wrong but it solved my gradle error)
I found this post helpful:
"It can happen when res folder contains unexpected folder names. In my case after merge mistakes I had a folder src/main/res/res. And it caused problems."
from: "https://groups.google.com/forum/#!msg/adt-dev/0pEUKhEBMIA/ZxO5FNRjF8QJ"
I used a local distribution of gradle downloaded from gradle website and used it in android studio.
It fixed the gradle build error.
Edit the gradle wrapper settings in gradle/wrapper/gradle-wrapper.properties and change gradle-1.6-bin.zip to gradle-2.4-bin.zip.
./gradle/wrapper/gradle-wrapper.properties :
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
It should compile without any error now.
Note: update version numbers with the most recent ones