How do I create an Android App Bundle using Android Studio, command line (first steps from Android instructions don't work, not fully explained)? - powershell

Hello and thanks for helping me solve my problem! I ask for an easier way, as I am trying to figure it out without success in this tutorial https://developer.android.com/guide/app-bundle. So far, I only worked with the Google Play Console itself, did not create an application in a third-party service. I first tried to download the Android App Bundle using Android Studio as described in this article https://medium.com/androiddevelopers/building-your-first-app-bundle-bbcd228bf631, but the first step describes pressing buttons that are not on Android Studio Panel "In Android Studio, select“ Build => Generate Signed Bundle / APK ”and follow the dialog." I do not see the options I need in the Android Studio panel (I attach a screenshot)enter image description here
, where do I need to click to create an Android App Bundle? Then I tried to create the Android App Bundle from this tutorial using the command line https://developer.android.com/studio/build/building-cmdline, I installed Grable manually as described in this tutorial https://docs.gradle.org/current/userguide/installation.html#installation unpacked and configured the system environment, as well as installed and unpacked JDK 17 for Windows/x64 (also on disk C but in a different non-Grable folder), but verifying the Grable installation when typing gradle -v in Windows PowerShell throws an error, and these instructions https://docs.gradle.org/current/userguide/troubleshooting.html#sec:troubleshooting_installation does not offer a solution what is displayed in my Windows PowerShell enter image description here
(The sentence highlighted in red from the screenshot in English looks like this "grable: The name grable is not recognized as the name of a cmdlet, function, script file or executable program. Check the spelling of the name, as well as the presence and correctness of the path, and then try again."), and when I enter gradle -v into the command line, it says "Grable is not an internal or external command, an executable program or a batch file.", I face the same problem if I enter into command line ./gradlew bundleRelease as suggested in this tutorial https://medium.com/androiddevelopers/building-your-first-app-bundle-bbcd228bf631. I'm stumped, what am I doing wrong, and what method is easier for me to create an Android App Bundle? Thanks again for the help in solving my problem and I apologize in advance if I have provided little information necessary to solve my problem.

Related

Flutter Windows Desktop app gets stuck on white screen after msix installation

Background
I just developed my first flutter desktop app for a windows machine. The app is working fine while developing/debugging it, but I am trying to test it as an application in release mode.
What’s done
I created an msix using pub msix.
For signing, I have tried both my
own certificate and the test certificate that comes with msix
packages by default.
I have tried both stable and beta channels.
Actual Problem
When I install the app on the other system (or even on the actual system where I debugged the app). I can install the msix setup successfully I can see my app listed in the apps, but when I try to open it, it is stuck on a blank/white screen. There is no UI rendered. And if I try to maximize the window, it goes to App not responding state.
Any help will be really appreciated.
Thanks in advance.
Update / New Finding
After going through the links provided by Yehuda Kremer and pulling my hair for a few days, I found the answer in this tweet
https://twitter.com/FilledStacks/status/1436280577439715338?s=20
So the main issue is that app is using some absolute paths that don't work on other machines (after release)
1- My app was using a database, so I have made sure that that database path is relative to the application document directory.
2- Now the build is also referring to some dependencies and their paths are also absolute. I have noticed a flag CMAKE_INSTALL_LOCAL_ONLY in the cmake_install.cmake but that flag is not being set anywhere.
Here is the log of flutter build windows -v
https://pastebin.com/LAeshUMY
-- Now I am looking for a proper way to convert all the paths to relative so that the build is ready for installation on different machines, instead of local installation only.
I have found the solution.
The main problem was that the app was looking for some dependencies and it was unable to find them. As mentioned here.
The reason for not finding that in release mode can be one of the following,
You are using some dll (package that depends on a dll) that is available on a specific path in your system, but when you are release the app that (absolute) path is not valid anymore.
You are adding some asset with absolute path (that is only applicable to your system).
Solution:
If it is a dll, you should be adding that to the release folder. In my case it was sqlite3.dll
If it is some other asset then you should always use the relative path.
You mentioned msix package, let see if the problem is in the app or in the packaging process
run flutter build windows without the flutter pub run msix:create, then run the created .exe file to see if its work.
btw this issue mention here: https://github.com/flutter/flutter/issues/74507
and here (the 'maximizing' problem): Black screen appears on maximizing and minimizing flutter desktop app

flutter application is not created even after the andrroid and flutter plugin installation setup

flutter application is not created even after the android and flutter plugin installation setup.
I have followed the following steps as given in the link
Flutter Installatioon steps
I dont know where I went wrong,. which installation steps I have missed.
My system is windows 32 bit.
I am encllosing the required screen shotsError screenshot
my system configuration
User Variable. path
Pleasee help me by fixing this issue
Try using Git instead of command line (cmd) and fix the path for flutter you should get the correct address for that for example: C:\flutter\bin

Flutter error: Unable to locate gradlew script

I can't run all of my flutter apps, because in the console appears everytime this error message:
Downloading Gradle Wrapper... 1,2s
Launching lib\main.dart on SM G960F in debug mode...
Running Gradle task 'assembleDebug'...
Finished with error: Unable to locate gradlew script. Please check that C:\Users\...\android\gradlew.bat exists or that C:\Users\...\android can be read.
I try to fix this problem more than ten hours and don't find a solution.
I will advise you to check your pc properly for unwanted programs. Something is preventing your pc from running the Gradle. I had the same issue only to realize that antivirus was installed on my pc alongside a cd burner that I just installed. Check for any antivirus that might be preventing Gradle from running.
I also faced the same error initially. While creating a flutter application from scratch I just ran the default flutter application which is a counter app in a flutter. I faced the same issue at first. If you are in this same context as described earlier the following could be the solution
1.Java 8 is more suitable for the flutter/android development. The next versions of java have some exceptions. I used the Java 14 and stuck at this issue for some time
The next could be the JAVA_HOME path in your environment variables. If it is not provided the set the JAVA_HOME path.
Run flutter --doctor and check the requirements if satisfied like Android SDK is updated or not, upgrade flutter if required. In some cases having good Internet connection also plays a role in this issue some times.
These are the major points to be satisfied in order to get rid of this error. Mostly this could be the a solution or part of it.
The error suggests that something is preventing gradle to run properly on your machine. Check whether you have any unwanted programs or anti-virus on your machine running that might be preventing gradle to run. If so, remove or stop those programs / anti-virus and try again.
After that, delete the .gradle folder located here C:\Users\yourPcName\.gradle containing the unfinished file and try again . It will work now .
You can also manually download Gradle and map it in Android studio , Learn more with this article here .
Warning, the gradle versions change quickly, so make sure you manually
downloaded the exact version that flutter wanted to download and the
download failed. Download the gradle here and then replace it in the
gradle folder.
C:\Users\yourPcName\.gradle\wrapper\dists\gradle-x.x.x-all
If it still doesn't work,
Try to run flutter --doctor
From a console window that has the Flutter directory in the path (see above), run the following command to see if there are any platform dependencies you need to complete the setup:
C:\src\flutter> : flutter doctor
This command checks your environment and displays a report of the status of your Flutter installation. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).
You can learn more here :
If flutter doctor itself doesn't work, then know that flutter is not installed on your machine (or you forgot to add it to the environment
variable).
I also faced this problem and I made something to run my app on android
tried to open anything on android files and android studio ask me if I want to open for editing android file in android studio then click on it and it will open android project then click run enter image description here

Getting Flutter doctor to work

How do I get flutter doctor on my Windows 10 laptop to work, please?
I followed the guidelines here,
Used git to clone the flutter repository,
git clone -b alpha https://github.com/flutter/flutter.git,
Tried adding "C:\Users\<user>\flutter\bin" to my path in the Control Panel
and then in an Admin Powershell, tried executing flutter doctor.
At first, it just hung.
After googling for help, I tried deleting the contents of the
C:\Users\<user>\flutter\bin\cache folder and re-executing flutter doctor but to no avail.
Then, I tried deleting all of flutter and cloning again but flutter doctor just hung again but with, Updating flutter tool.
Tried a few different Googled PATH-adding ideas (that seems to be a complex and disputed area.)
Got a new message: Waiting for another flutter command to release the startuplock
The latest state is that flutter doctor still just hangs but without any message.
I suspect the problem lies in the new Path not being properly recognised (in the registers??)
Can anyone help please?
Well, the issue is not clear enough, but this might be solution, if your flutter doctor is stuck, it might be due to Background Intelligent Transfer Service is disabled, in order to check for yourself, do the following:
Click on the start menu, and then start typing services.
Launch the services and look for Background Intelligent Transfer Service and make sure it is running.
At this stage I believe you will find it disabled for some reason, just right click on it and go to properties and start the service, also change the startup type to automatic.
I can not think of other reasons that might prevent flutter doctor to run for the first time on a Windows machine other than that honestly.
I know this question is a little bit old. Here is a solution that worked for me. Run the Command Prompt as an admin solved the issue for me.
For Windows user check to see if the unzipped flutter folder is read only. (i.e right click the folder then properties then in the attributes section untick the readonly property then apply this change to the folder along with the sub-folders then ok and thats it. Worked for me.
Some errors I got and how I fixed it:
(ERROR 1):
[flutter] flutter doctor -v 'crumb' is not recognized as an internal or external command, operable program or batch file.
Error: Unable to find git in your PATH. exit code 1
(Fix) - Go to flutter installation folder and inside flutter/bin edit the flutter.bat file using a text editor and remove the line (20) that says:
IF EXIST "%mingit_path%" SET PATH=%PATH%;%mingit_path%
The code should look like this on those lines:
REM If available, add location of bundled mingit to PATH
SET mingit_path=%FLUTTER_ROOT%\bin\mingit\cmd
Save and Run flutter doctor and everything should work fine.
(ERROR 2):
flutter doctor takes too long
(Fix) - I downloaded the previous version of the sdk it worked like a charm.
(ERROR 3):
Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.
(Fix):
Open Android Studio
Tools Menu, SDK Manager
In the window that comes up there are inner panels, choose SDK Tools panel
Tick Android SDK Command-line Tools
Choose Apply button near the bottom of the window
This worked.
(ERROR 4):
The term 'flutter' is not recognized as the name of a cmdlet, function, script file, or operable program.
(Fix) - Put the correct part in the env variables. I had put D:\flutter instead of D:\flutter\bin. That worked.
I got a solution that worked for me
initially i had downloaded the 2.2.5 SDK which gave the forever run error so i went back and downloaded the previous version ie 2.2.2 it worked like a charm
The Flutter SDK is installed in a protected folder and may not function correctly. Please move the SDK to a location that is user-writable without Administration permissions and restart.

"Cannot find Rhodes" creating a new Rhodes application in Eclipse

I just started with Rhodes cross platform mobile application development. I followed the rhostudio tutorial to install RhoStudio and to start creating a Rhodes application.
Once I click the Finish button in create new project wizard I get an error message:
Cannot find Rhodes, need rhodes version equal or greater 3.0.1
Your linked tutorial says:
RhoStudio is an Eclipse plugin [...]
You'll need to install the actual development-platform, too. A tutorial on how to do this can be found here.
You should also be sure to enter the path to your Rhodes-installation as illustrated here.
Make sure you're opening Rhodes from the correct file. On a Mac, the file to open is /Applications/Motorola RhoStudio/RhoStudio 64 bits (UNIX Executable File). The terminal prompt will ask you what version of Ruby you want to work with, and RhoStudio will open correctly once you answer. I would assume that on the PC you'll want to open whatever link leads you to the same prompt:
Select Ruby version to start RhoStudio:
1) ruby-1.9.3-p194
On the other hand if I open macosx.cocoa.x86_64/RhoStudio.app, then everything seems fine at first but you get the "Cannot Find Rhodes" error when creating a new RhoMobile project.
This is what worked for me:
1) Uninstall rhode studio
2) Run "install gems" file
3) Reinstall rhodestudio
4) Create your project