Flutter app not working in apk-release but works in debug mode (even after giving internet permissions) - flutter

My app works fine in debug mode. I followed all the steps mentioned in flutter docs for making apk-release. I even mentioned the internet permissions for the apk-release in AndroidManifest file. My apk-release builds perfectly fine. But when i install it in my phone and try to use the app(Basically login using phone number cause the first page in my app is the login page), it doesnt respond. I figured there must be some problem with the internet permissions but I rechecked everything. It all works fine when i install the debug apk from Android Studio, but the release apk is somehow unable to communicate with the authentication servers. Please help me.
Btw, I updated all the dependencies in pubspec.yaml like cloudfirestore versions and stuff. Still no change. Also, I guess my SHA1 key is right in firestore. I also had to rename my package name from com.example.pareez to com.rishav.pareez but I am sure I made no mistake in that.
I ALSO USED THE SAME key.jks WHICH I USED TO MAKE AN APP YESTERDAY.
UPDATE - I uninstalled the previously installed apk from my phone and I used flutter install from my pc and then the app ran perfectly well. I guess installing manually is giving me problems. But i installed other apps manually too, and they worked fine.

Build your aab bundle or apk using the below commands.
For aab bundle:
flutter build appbundle --no-shrink
For apk:
flutter build apk --no-shrink
This solution worked for me. I hope, this will also help you. Thanks for asking this question.

Related

Can't use cloud debugging to test my apk for Huawei

I'm trying to test an apk with cloud debugging and I'm getting the following error when I tried to upload an apk:
I also added HMS plugin to my Android Studio but devices are not displayed in the device list when I opened one and it doesn't end or give any feedback(other than files are being pushed) when I drag an apk onto device.
Devices that I tried:
Update:
The apk you uploaded does not have an icon. Plz check and add an icon for it and try again. This message will be modified later to make it clearer. :)
It is a network error. Make sure that no proxy is used and your network is working. Then plz try to retransmit the apk.
Yeah I have encountered the same issue in the past and that could be frustrating. One thing you have to know though, for Cloud debugging, the backend servers are on maintenance from time to time. Please try to upload your APK again and see if your issue gets resolved by itself. If not, please let me know, I will see if more trouble shooting can be done.

flutter debug APK not installing on mobile

Am not able to install the APK in my mobile generated by gradle. it's working fine on an emulator but when I try to install on my mobile its starts installing and in the middle, it gives the error APK not installed. Am running android 10. Paths from where I picked the debug APKs are as follow.
<project>/build/app/outputs/apk/debug/app-debug.apk
<project>/build/app/outputs/apk/debug/app.apk
<project>/build/app/outputs/flutter-apk/app-debug.apk
It seems your apk does not have certificate yet.
you cant install it just like that. you can either certify it build release android app
or set your phone to install app form unknown source. in app settings or security settings
If you're trying to manually install the app-debug.apk, you should rather consider generating app-release.apk but if you can't debug the app, then you might considering opening up your developer options.

Error while uploading Flutter App to App Store: Non-public API usage

I am new in Flutter Development and i have developed an app with Webview.
I have upload an apk on Google Play Store that is accepted but for App Store it shows some error.
Please find below error,
ITMS-90338: Non-public API usage - The app references non-public
symbols in Frameworks/Flutter.framework/Flutter: _ptrace. If method
names in your source code match the private Apple APIs listed above,
altering your method names will help prevent this app from being
flagged in future submissions. In addition, note that one or more of
the above APIs may be located in a static library that was included
with your app. If so, they must be removed.
For this error i have search many things but i am unable found any solution for this.
So please any one who is capable of solving this please help me to resolve this.
Thanks & Regards,
This happens if you are submitting the debug version to the AppStore, Flutter team recommends you to first run
flutter build ios --release
before archiving your app in Xcode.
First make sure you are submitting a release build with flutter build ios --release
If that's not the problem here you could find similar problems related:
flutter build ios --release may use a debug Flutter.framework by mistake
In my case, I updated my Mac to 10.15(Catalina), while the update my cocoapods installation wasn't there. So whenever I try to upload using the command flutter build ios --release and archiving it. Apple sent me the same email you received.
You can install cocoapods using the following commands.
step 1 Open terminal
step 2 command: sudo gem install cocoapods
step 3 set your project path on the terminal.
step 4 command: pod init
I hope it helps.

My Ionic app works fine on browser but does not open in my phone

my ionic project works fine with ionic serve --lab ,but while copied the.apk file in build folder to my phone and install the app but blank screen appears ,
Please can anyone suggest what might be my problem
my app is using google maps,key is provieded for both app and browser in index.html
Have you tried running it in the emulator ? Since its much easier to see the error logs . Try ionic emulate android -l or ios -l (whichever OS you are building for) and then once the execution starts run the command consolelogs it will log all the activity and you will have a better understanding about why its not working.
+1 for using Chrome Remote Debugging feature. It give you the same output as you would receive from running you app in the browser.
Additionally, I have found that sometimes if your app is already compiled, the ionic CLI doesnt always copy your current files into the APK, and uses the older cached files instead. If you are banging your head against the wall, run the following commands to make sure you have your latest code in your APK.
ionic platform remove android
ionic platform add android
ionic run android
I suggest you use the Chrome Remote Debugging feature. I encountered the same, and looked for answers to my symptom for hours. Once I connected to the chrome remote debugger, I got the console.log back, and noticed there was a problem in my routing setup.
It was a problem with ionic CLI. I've updated it to the latest and reinstalled all dependencies.

Re-installation failed due to different application signatures

I moved my Android project to a laptop and now I get this when I hit Debug. Sounds like this is a bug? This shouldn't happen via Eclipse as far as I know.
Re-installation failed due to different application signatures.
The weirdest thing is this happened after I upgraded sdk/adt and Eclipse to support SDK 2.2 It was working fine earlier, and now it doesn't, so it might be a bug.
It happens because keystores on your laptop and original pc are different. it's called debug.keystrore
and located in %USER_HOME%/.android/ folder. TO be more specific it happens because eclipse tries to push apk with reinstall key. So you have two options
Share debug.keystore between various development pc's
Manually uninstall your apk from device ( using adb )
I also got the same problem and fixed it. you should do the following to fix it,
Uninstall the application from your mobile if you load it
already.
To uninstall goto settings->application->manage application.
Run the application again and choose the mobile
Hope this will help you
After you copy debug.keystore to your PC, you need to rebuild project on PC.
I had the same issue using the Droid emulator. I solved it by uninstalling the package from the application settings in the emulator as you would a normal device. On the next run, it reinstalled and the error went away.
I got the same problem and fixed it by just wiping the user data on the emulator. My guess is that the emulator keeps the project installed unless you wipe the data, so if your new project doesn't match some internal parameters it doesn't like it and won't reinstall it.
I also had the same problem and fixed it by uninstalling the app and reinstall it again.
ah i think i found your answer:
Why does the app signature change in Android after a classpath change?
its changed if you change the classpath
After searching and checking the phone, i came to know that i am currently developing 2nd version of this application which is already downloaded from android market in my phone, now as this app is signed and having different signatures this is throwing the above error.
Now, to resolve this issue, i had just uninstalled the app from mobile and run/install the application again.
I had the same issue with the emulator and i ran the command "adb uninstall TheNameOfPackage". Of course you must first go to the directory where the adb.exe has been installed, usually C:\Program Files\Android\android-sdk\platform-tools, and then run the above command.
For me after I copied all of my keystore files from my machine at home, I had to do a Project->clean. After that it worked perfectly.
When i tried to uninstall the application from my device after this issue occurs, i cannot able to find the app in my device. I don know where it gone. Then i uninstalled using adb,
adb -d uninstall <app package name>
This is the answer who are facing the issue similar to my problem.
I had the same issue.
To fix it I uninstalled the old .apk of the project from my device.
Go to device/emulator Settings -> Apps, find your app and uninstall it.
Or
In Android Studio open tab "Gradle" (on the right side), open:
appName
..appName
...Tasks
....install
.....uninstallAll
and click twice on this task to execute it.
Important note:
If you still get this error after uninstalling, try to Build->Clean Project.
If you still get this error, even if in your device Settings->Apps list you have no this app already, try to Build->Clean Project