Exception: Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\Users\airbu but the tool couldn't find it - flutter

Exception: Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\Users\airbu\Desktop\KREAAPPS\hotel_booking_app\build, but the tool couldn't find it.

Related

Deep AR Flutter: Direct local .aar file dependencies are not supported when building an AAR

I'm following the documentation as given in the plugin page on camera_deep_ar
I have set the minimumSdkVersion to 19
Given the permissions correctly in the AndroidManifest.xml
Set up the proguard-android.txt file correctly
And used the sample code given in the docs
This is the error it gives me on running the app.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':camera_deep_ar:bundleDebugAar'.
> Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error).
The error seems to be thrown from the camera_deep_ar plugin. Try rebuilding the Flutter project to check if this can solve the references in the project. To do this, run flutter clean then flutter pub get.

why do I get Gradle task assemble Debug failed error

I imported a flutter project from GitHub. when I tried to run it I had this error(no errors in code). I could not figure out what this error is all about and I keep getting this error for every project which I import from GitHub.Please help me out!
This is the error:
Exception in thread "main" java.util.zip.ZipException: error in opening zip file.
Gradle threw an error while trying to update itself. Retrying the update...
Finished with error: Gradle task assembleDebug failed with exit code 1.
It's kinda common problem when you get a project from github and I solved it once with this answer.
Copy paste from there:
Open your Android Studio preferences(Command + ',') and go to
Languages and Frameworks -> Dart
Check "Enable Dart support for the project your_project_name"
In "Dart SDK path" click in "…" and navigate to flutter SDK directory.
Under that directory you'll find "bin/cache/dart-sdk". This is the
dart sdk path you should use.
Click "Apply"
flutter packages get
flutter run

Flutter get error "Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain"

I'm trying to run my project , I am getting error
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Exception: Gradle task assembleDebug failed with exit code 1
It is hard to know the problem with so little information. One general approach with worked to me was performing:
flutter clean
Try to run.
If it does not run delete the jar file under android/gradle/properties to recompile it and try again.

Build failed - flutter.gradle

Flutter run produces the following error:
Target debug_android_application failed: Exception: Failed to bundle asset files.
build failed.
FAILURE: Build failed with an exception.
Where:
Script '/Users/kirk/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 896
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/kirk/Developer/flutter/bin/flutter'' finished with non-zero exit value 1
Any potential solutions on how to fix this?
i think that you have compatibility issues between the build tools located in android/build.gradle and the gradle located in android/gradle/wrapper/gradle-wrapper.properties, try upgrade or downgrade one of them to be compatible with the other, check this table for compatibilites: https://developer.android.com/studio/releases/gradle-plugincompatibilites
I had exactly the same problem where I couldn't compile or debug my Flutter app. To solve this, just go to tools and in Flutter selection, click on {open project for editing in Android Studio}. This will open only the Android counterpart and you will be able to update your gradle dependencies once the analysis is finished.
I have face similar issues so after spending lot of time i have found if we can write full path for assests file then it works please check below example how it is defined.
assets:
- assets/bg_screen_page.png
- assets/logo.png

Intel XDK Google + google services plugin - build fails

I have developed a working hybrid application in which I am using "phonegap-googlemaps-plugin". This plugin needs as a dependency two other which downloads and installs automatically in the project. The dependencies are:
com.google.playservices and plugin.http.request
Using the Cordova-CLI, installing this plugin with the dependencies will fail building the project the 1st time because of a specific directory in the "playservices" plugin. To overcome this, I have to run "ant clean" in my project and also remove/rename that directory. Now, I am using Intel XDK and uploaded my app and installed most of my plugins successfully and run the application on my device. When I am trying to install the google play services plugin, it fails to build because of the reason I described above (I've run through the logs). How can I overcome this issue now?
I have attached the part of the log that shows the fail error
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[aapt] invalid resource directory name: .../App/platforms/android/com.google.playservices/google-play-services_lib/bin/res/crunch
BUILD FAILED
/Developer/android-sdk-linux/tools/ant/build.xml:653: The following error occurred while executing this line:
/Developer/android-sdk-linux/tools/ant/build.xml:698: null returned: 1
Total time: 5 seconds
Error code 1 for command: ant with args: release,-f,.../App/platforms /android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Command finished with error code 2: .../App/platforms/android/cordova/build --release
Error: .../App/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/Developer/cordova/3.5.0-0.2.7/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
Thanks in advance.