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

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.

Related

Flutter - Gradle task assembleDebug failed

When you run flutter run, such an error is displayed, when checking flutter doctor no error, what is the reason?
I was facing the same issue for my project earlier and found the solution as below.
I have changed the Gradle wrapper properties distribution URL version to: 5.5.1-all which was available in my system.
Due to some reason, the android studio was fetching the latest version which was not in my system.
Problem:
Zip error occurs while compiler tries to wrap code with Gradle wrapper properties.
If the required files are missing or not properly available after downloading, this error occurs.
Solutions:
1) Redownload the Gradle which you are using currently.
2) Change the version of Gradle wrapper property version available in your system.

Reference Local Path Package in Dart-Web Application

I sucessfully split up a flutter mobile application in to packages. One package is referenced by the flutter mobile app by using the following in the pubspec.yaml:
app:
path: /path/app
The fultter app builds and runs just fine and no problem is reported by the IDE (visual code) when it does the 'pub get'
When I do the same thing in the web-project the IDE complains on 'pub get' with:
Error on line 8, column 5 of pubspec.yaml: A version constraint must be a string.
When trying to build web project by issuing the command:
webdev build
I get the following error:
build_web_compilers:entrypoint on web/main.dart (cached): Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).
I even tried to use Windows native top level path (C:\path\package) but without a changed outcome. It seems that webdev does not support local path packages like described by the official PackageDependencies | Dart manual page.
When using shorthand and creating the web project it does not create a dependencies section in the pubspec.yaml file. I added another dependency (package) right under the environment section where the SDK is also configured.
It does not complained about the package dependency being under environment but it complains about a package dependency that has no version but a path.
I only noticed when I used a symlink to add the lib's source folder (lib) directly to the web project as it kept complaining about not finding this said package dependency.
Checking the packages file the package was not mentioned and in the pubspec.lock file the package was listed under the 'sdks:' section.
By creating a 'dependencies:' section and putting both dependencies under it, it now works as intended... . Case closed!

App crashes on startup for firebase_admob dependency 0.8.0+4

I was using fiirebase_admob dependency 0.5.5 which was working great but when I went to release the apk version by flutter build apk --release it gave me error so I had to change the dependency from 0.5.5 to 0.8.0+4 and add API 'com.google.firebase:firebase-ads:16.0.1' in dependency of build>gradle this gave me the app-release.apk but causing app is crashing on startup. So, what should I change my dependency to get the app running smoothly?.
look for the file project.properties and modify the dependencies there with the versions that the error marks, the file build> gradle is modified each time the packager executes, so it does not keep them.

How to add a fork github package to the pubspec.yaml?

map_view plugin is no longer maintained and let users with problems if the min sdk is up to 28, so luckily Eimji fork a modified version of the package but it's only on github https://github.com/Eimji/flutter_google_map_view and not on https://pub.dartlang.org I search to add his fork to my pubspec.yaml.
I tried
flutter_google_map_view:
git://github.com/Eimji/flutter_google_map_view.git
Thank you
Update
I changed name by map_view it seems accepted ...
but when I use flutter_google_map_view I have
Error on line 1, column 7 of flutter_google_map_view\pubspec.yaml: "name" field doesn't match expected name "flutter_google_map_view".
I don't know why map_view "works" but not mapview ...So I don't know if it's really accepted or the great methode ...
So now I have other issue when I upload my local map_view package ...
* Error running Gradle:
Exit code 1 from: C:\Users\utilisateur\AndroidStudioProjects\nirbi\android\gradlew.bat app:properties:
WARNING: The specified Android SDK Build Tools version (25.0.3) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (25.0.3) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (25.0.3) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':map_view'.
> Failed to notify project evaluation listener.
> java.lang.AbstractMethodError (no error message)
I search buildToolsVersion '25.0.3 from my build.gradle file , but nothing like this. So I add buildToolsVersion '28.0.3' in build.gradle but have always the same error ...
Update
I remove all "buildToolsVersion '25.0.3'" it seem working and now I have this last issue :
* Error running Gradle:
Exit code 1 from: C:\Users\utilisateur\AndroidStudioProjects\nirbi\android\gradlew.bat app:properties:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':map_view'.
> Failed to notify project evaluation listener.
> java.lang.AbstractMethodError (no error message)
I think map_view is not correctly accepted ...
Update
Some suggestions to simply import this github package https://github.com/Eimji/flutter_google_map_view to pubspec.yaml ?
when I use
flutter_google_map_view:
git: git://github.com/Eimji/flutter_google_map_view.git
I have this error ...
Git error. Command: git clone --mirror git://github.com/munificent/map_view.git C:\Users\utilisateur\AppData\Roaming\Pub\Cache\git\cache\map_view-84b47933c6a730a2f0624a589576e53be480ad60
Cloning into bare repository 'C:\Users\utilisateur\AppData\Roaming\Pub\Cache\git\cache\map_view-84b47933c6a730a2f0624a589576e53be480ad60'...
Update
I tried my last chance ! import map_view: ^0.0.14 (no compatible android X) and add manualy all modification did by Eimji https://github.com/Eimji/flutter_google_map_view/commit/5b631c499783936dfc462039274a6f5c59323068#diff-7ae5a9093507568eabbf35c3b0665732
I have this error
* Error running Gradle:
Exit code 1 from: C:\Users\utilisateur\AndroidStudioProjects\nirbi\android\gradlew.bat app:properties:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':map_view'.
> Failed to notify project evaluation listener.
> java.lang.AbstractMethodError (no error message)
See https://www.dartlang.org/tools/pub/dependencies#git-packages
dependencies:
kittens:
git:
url: git://github.com/munificent/kittens.git
ref: some-branch
If pubspec.yaml is not in the root directory you can also specify a path
dependencies:
kittens:
git:
url: git://github.com/munificent/cats.git
path: path/to/kittens

Flutter build error. Issue with flutter webview plugin

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.