Flutter build error. Issue with flutter webview plugin - flutter

I have added the flutter webview plugin but its causing problems. Its giving some error when building the project. I tried to delete the cache and rebuild the project but it didn't work.
I just started learning flutter and can't find a solution to this problem.
Below is the error I am getting.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':flutter_webview_plugin:compileDebugJavaWithJavac'.
Unable to find source java class: 'C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.0.9+1\android\src\main\java\com\flutter_webview_plugin\WebviewActivity.java' because it does not belong to any of the source dirs: '[C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.1.5\android\src\main\java, C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.1.5\android\src\debug\java, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\r\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\buildConfig\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\aidl\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\rs\debug]'
BUILD FAILED in 54s
Finished with error: Gradle build failed: 1

I was using other plugins for firebase auth, firebase analytics, google sign in , webview, ect. Updating all the plugins to the latest version solved the problem.

Related

Execution failed for task ':video_player:compileDebugJavaWithJavac'

I am trying to run my flutter project but I can't. I receiving the following error from the console:
Execution failed for task ':video_player:compileDebugJavaWithJavac'. > Compilation failed;
I have tried different versions of the video_player package but it doesn't work.
Please update your android studio.
make sure that you have updated everything in android studio.

Flutter Build Error: Execution failed for task ':sms:verifyReleaseResources',A problem occurred evaluating root project 'firebase_auth'

I am creating a simple app that consist of sms retrieving and firebase mobile OTP modules, everything works fine only on app running but could not build apk for output.
Errors:
Execution failed for task ':sms:verifyReleaseResources'.
A problem occurred evaluating root project 'firebase_auth'.
I have no idea for first error, but the second one is most related to firebase_core plugin. but i have added it too. let me know where i made mistakes.
I have tried all possible ways that is, cleaning build and reinstalled the plugins noting works for me.
installed plugins:
sms: ^0.2.4,
firebase_auth: ^0.19.0,
firebase_core: ^0.6.0,

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.

Cordova-camera plugin

When adding cordova camera plugin into my project then i am facing cordova build problem as follows:
Step 1: Adding ionic cordova camera plugins
Step 2: try to build the native app using ionic cordova build android --debug
then the following error is displaying
Task :app:transformClassesWithMultidexlistForDebug FAILED
D8: Program type already present: android.support.v4.app.ActionBarDrawerToggle$Delegate
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
com.android.build.api.transform.TransformException: Error while generating the main dex list:
Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.app.ActionBarDrawerToggle$Delegate
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --debug exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
This problem may be from your AndroidManifest.xml. Open your AndroidManifest.xml file and find android.support.v4.app.ActionBarDrawerToggle, you will find two line for this. Comment one of them and keep only one android.support.v4.app.ActionBarDrawerToggle. Then try to run again.
This will may help you.
I change cordova-camera plugin version from 4.3.0 to 4.1.0 and now it works well this may be ionic v4 plugin issue
install the latest cordova platform[
]1

Unable to build ionic app using the ibm-mfp-push cordova plugin on Android (conflict with google-analytics cordova plugin)

I've been developing an Ionic app for several months, successfully using the ibm-mfp-push plugin for Push Notifications.
I would now need to use the cordova-plugin-google-analytics plugin.
I've added the plugin to my project and was able to make it work properly on iOS.
But when trying to build the project for android, I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpz;
Seems like there is a conflict between ibm-mfp-push and cordova-google-analytics.
Could someone please provide some help?
Thanks
Right now adding this Google Analytics plugin for Cordova does result in a conflict with the ibm-mfp-push plugin -- I am able to recreate and confirm. I've let the service team know.
For the time being, I recommend using the native solution for Android.