-
Notifications
You must be signed in to change notification settings - Fork 27.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package_info broken on ios #20761
Comments
|
I have found out how to reproduce this stack trace.
line in pubspec.yaml If you comment out this line (or use an old project which does not have this line). Then you need to do a clean (I do it in XCode). You will get the stacktrace at the fromPlatform() line. |
/cc @bparrishMines too @Rockvole thanks for reporting this! Sounds like us failing to check for |
You are welcome :) |
I also have this issue. When I first used this feature on Oct 9, 2018, it worked correctly.
I had done other code changes in the application, and flutter upgrades. For me, the crash only presents on iOS (not Android), and only in debug mode.
|
I have problems to reproduce it :-( When I comment out
and if it is not commented out I get:
In both cases, the app runs on iOS and shows the values of
|
to test it I used the code from the package_info example with package_info version 0.3.2 |
This is also broken for me. I am getting an immediate "Lost connection to device" when using the PackageInfo.fromPlatform(); call. No logs from flutter, I do get logs when running in Xcode:
Edit to add: I am using this within a package I am generating. I have been able to reproduce it from a fresh package built from Edit 2: Just adding that I believe I got this fixed. The example project was not properly setting the flutter properties in the plist. I replaced the following with actual string values and it is working:
I'll leave it to people much more familiar than myself to determine if this is a bug or I just don't know what I'm doing. |
Same Problem here! |
This also came up recently in my discussion with @matanlurey |
The crash on iOS has been fixed on package_info version 0.3.2+1 |
I got a similar issue with yours. Instead of manually changing the values of
I just deleted the /ios folder and recreated it again by running |
@cyanglaz I still don't get the
version == null
buildNumber == ''
|
@herkulano are you checking it on a real device or simulator? Can we post your flutter doctor -v here? |
@cyanglaz I'm using the simulator only. void checkPackageInfo() {
PackageInfo.fromPlatform().then((packageInfo) {
print('--> appName: ' + packageInfo.appName);
print('--> packageName: ' + packageInfo.packageName);
print('--> version: ' + packageInfo.version);
print('--> buildNumber: ' + packageInfo.buildNumber);
});
}
void main() {
checkPackageInfo();
runApp(App());
}
|
Your code snippet works for me. Could you check if your iOS runner app has version and build number set up?
|
@cyanglaz it's set to:
|
@herkulano Did you set version in your pubspec.yaml. Like version: 1.0.3+2 where 1.0.3 is FLUTTER_BUILD_NAME and 2 is FLUTTER_BUILD_NUMBER |
@cyanglaz I ended up solving it by recreating the files and going through the changes with
|
For my current project setup (several flutter version updates) I have out of sync flutter app iOS version with |
2020 update: Have tried it on iOS and build number seems to be updated without any issue... Am I the only one? 🤔 |
I still see some issue with ios |
@maheshmnj Which kind? Could you please share some logs? |
my flutter doctor -v shows this output
|
however when i manually change the build in xcode and rebuid the app it works :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I read the package_info in my code which works fine on Android.
On the IPhone 6 Plus - 11.4 the code just gives a stack trace.
Code line which crashes :
Version of package_info is the latest ^0.3.2
Error is :
The text was updated successfully, but these errors were encountered: