Error on converting flutter project to APK, error files coming from AppData - android

So I tried every possible way and ask from different people, and I also tried updating dependencies on my project but to only possible latest version since there's a version constraint. Here's the full error
https://pastebin.com/r6ZEPURC
Script 'C:\Users\Rodrigo\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1151
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'C:\Users\Rodrigo\flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1
How can I fix this issue? thanks.
I tried updating my dependencies and changing some parts of my code, but it still doesn't work. I was trying to build it into an APK for a few days now, but I still get the same error.

There is a known issue with the modal_bottom_sheet package conflicting with material bottom sheet. You need to follow the recommendations there to get your app to build. See: https://github.com/jamesblasco/modal_bottom_sheet/issues/328
As a general rule, it is always a good idea to check the package's GitHub repo issues section when you see errors like this.

Related

Flutter - Can't build apk. Execution failed for task ':app:minifyReleaseWithR8'

I'm trying to build the release apk of my project and stumbled on this error today:
R8: Type io.flutter.plugins.webviewflutter.GeneratedAndroidWebView$WebViewClientHostApiCodec is defined multiple times
What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /flutter/.pub-cache/hosted/pub.dartlang.org/webview_pro_android-2.8.3+3/android/build/intermediates/runtime_library_classes_jar/release/classes.jar:io/flutter/plugins/webviewflutter/GeneratedAndroidWebView$WebViewClientHostApiCodec.class
This is related to the flutter_webview_pro plugin. I'm using the 3.0.1+3 version. I've tried to open an issue on the plugin's github page, but can't find the Issue tab. Is there a better alternative to this plugin? Can't use the official one because it doesn't support opening a file chooser on Android. Thanks for the attention in advance.
Sadly I didn't find the answer to solve this problem and decided to use another plugin for the same purpose: https://github.com/pichillilorenzo/flutter_inappwebview
I believe you were probably importing another package that this webview_pro also imports, maybe even the default webview_flutter

weird gradle warnings during react-native variant-release build

(using android,
openjdk-11.0.13_8
node v16.13.2
react-native 0.67.0)
i created a barebone react-native project with
npx react-native init testapp
then signed it according to official react-native documentation
then tried to create the release-variant with npx react-native run-android --variant=release
now i get BUILD SUCCESSFUL message and got apk, and it installs and works in my physical device...
BUT, i got a lot of gradle problem-warning ...here is one sample..
Task :app:processReleaseManifestForPackage Execution optimizations have been disabled for task ':app:processReleaseManifestForPackage' to
ensure correctness due to the following reasons:
Gradle detected a problem with the following location: 'D:\testapp\android\app\build\intermediates\merged_manifests\release'.
Reason: Task ':app:processReleaseManifestForPackage' uses this output
of task ':app:copyReleaseBundledJs' without declaring an explicit or
implicit dependency. This can lead to incorrect results being
produced, depending on what order the tasks are executed. Please refer
to
https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency
for more details about this problem.
this same problem-warning is repeated for many other tasks!!...
NB i havent added any packages or changed any source code.. its the barebone app coming with react-native!... so how do i solve this issue?.. how to fix my settings so that this warning can be removed...
(i copied one of these tasks-names and did a text-search inside all files in my project directory to find out where its mentioned...but shockingly, its not mentioned anywhere!!!...so where are all these problem-warnings coming from? and how can we get a neat gradle build?)
this same warning is repeated in lots of lines in gradle output for other tasks too, such as:
Task :app:compressReleaseAssets
Task :app:processReleaseManifestForPackage
etc.. etc..

Unity 2018.3 android dex merging issue

Before you decide to dismiss this post as "duplicate" without even reading it, understand that I have looked at a TON of posts related to this topic and I can't find a solution for my instance, including all of the ones that StackOverflow suggested. Most of the posts are for Android Studio instead of unity.
My error is given in Unity when trying to build to android, it crashes here.
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"
stderr[
D8: Program type already present: com.unity3d.ads.BuildConfig
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug'.
I've tried changing stuff with a build.gradle file like a lot of posts suggest, but I can't get anything to work.
The error didn't exist in Unity 2018.2. I checked right before I updated, but the update is now throwing this issue.
Does anyone have any UNITY specific ideas what to do here? I've tried so many things and nobody's post has been able to help me yet.
Thanks for any help
You can open the PackageManage under Window in the menu bar and remove Advertisement or you can delete the com.unity.ads file of Library/PackageCache in the project directory to resolve this issue.
This error probably happens when you add a library which is not compatible with your compileSdkVersion.
In your case you can have libs that were not imported by default by unity (and now are)
or there can be a problem with the Build Tools version. (You can try updating them)
I had similar problem a few versions ago, but I don't remember how I fixed it.
I didn't have time to upgrade to unity 2018.3 yet. (So the tips are more like guesses, but it may help you solve the issue.)
My settings (Mac):
- Android Studio 2.3
- Unity 2019.1.5f1:
- Player Settings -> Other Settings –> Scripting Runtime Version = .Net 4
- Package Manager -> Advertisement: Uninstalled
- Preferences -> External Tools -> Android: checked Installed with Unity (everything)
My solution:
- delete GoogleMobileAds from project
- delete PlayServicesResolver from project
- delete Plugins from project
- Import Package -> Custom Package -> GoogleMobileAds.unitypackage (3.15.1 in my case)
Dex Errors generally occur when you have too many methods imported in a project, not because of a specific package. I assume upgrading to new version made you import new stuff to your project.
You need to enable ProGuard.
Cause: http://twinkfed.homedns.org/Android///tools/building/multidex.html
Fix: https://www.youtube.com/watch?v=va0FQNlBUX0

Android Studio Execution failed for task ':app:mergeDebugResources' with special chars in username

i have a strange error with AAPT2 iin Android Studio. I think it has something to do with german special characters in my account name in windows.
If i set my gradle to version 3.0.1 and also set android.enableAapt2 to false everything works fine. But since i researched, setting the option is not a solution to the problem.
Now if i set the gradle version to 3.1.2 and remove android.enableAapt2 from the properties i get the following error message:
And this one:
One way to solve the problem was to create a new account in windows without special chars in the name. It compiled and did run very well. I really tried everything in the web but could not find a solution to the problem.
Maybe you can help me.
First of all check your build log botom of the build section you shared whether any error related to your project showing or not. If error showing then fix those. Build and run again and fix all the error comes up. It will eliminate aapt2 issue without changing android gradle plugin.
Secondly if there is not any project related error showing in the build log but still its showing aapt2 error then you can fix it by following below steps.
Update your android gradle plugin in your project level build.gradle file like below:
classpath 'com.android.tools.build:gradle:3.2.0-alpha13'
Now update android.enableAapt2=true. Then check and build your project.

Android studio How to resolve Error in png files of library added

I have no Idea what is happening, last time when I finished my app I build its release apk and all was working just fine as expected but now today when I tried to make that pproject again and to make another apk I am getting the following error.
Error:Execution failed for task ':app:mergeDebugResources'.
Crunching Cruncher common_signin_btn_icon_pressed_light.9.png failed, see logs
I have no idea how to resolve it I have serached and found restarting Android studio and clean the project would remove it , doing this many times has no effect on this error. I have even restarted my machine but the condition of error in same.
In the logs I have seen that this png file is from the library I added , so just for testing I removed that library and tried to build then it started to give me same error with different png file name in other library. So how to fix this issue ?
My Questions are :
How can this issue be Solved ?
Have some one faced this problem too ?
Is this problem has been reported to google ?
Why in android we do not have any stable platform for development as IOS have ?
Try to remove "builds" folders and do rebuild. But soon, the whole thing in a long file name. Read this answer. By the way, you looked logs? Maybe this is not the PNG? You have not sent the log and did not specify the version Gradle.
Believe me, iOS developers have own problems.

Categories

Resources