-
Notifications
You must be signed in to change notification settings - Fork 152
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
Patrol (native): packageName is not set. It's recommended to set it. #1416
Comments
Please show me the command you're executing. I'm pretty sure you're using |
Please show me your test code. |
Thanks for providing the sample code. |
This is the result I am getting if I remove it : lallu@Laliths-MacBook-Pro Next-Gen-App % patrol test -d emulator-5554 --flavor jk integration_test/app_test.dart • Building apk with entrypoint test_bundle.dart...
✗ Failed to build apk with entrypoint test_bundle.dart (Gradle build failed with code 1) (3.7s) |
Yeah... what version of the patrol package are you using? (please show me your pubspec.yaml) |
Also, it's quite strange what you're saying happens:
|
I am using patrol: ^2.0.0 and patrol_cli v2.0.0 |
Can you please suggest me from where should I make the setup for patrol from the scratch so that I can configure once again and come back to you with the result.? |
OK, so the latest ones - great. So that's not a problem. The whole native automation setup is described here. I suggest you step through it once again to make sure you've not missed any step. |
Let me do the native automation setup once again and will revert |
OK. It'd help if you shared your repository, so I can just clone it and see what the errors are. Much faster than guessing here :) |
Sorry for it as sharing the repository violates our company policy |
You only should change the package name at the top of MainActivityTesr.java file. |
Okay |
What do you mean by "it's running in an isolated environment"? I see it says that it's running on the connected Android emulator. Can you maybe show a screen recording? |
No it's not running in the device, it's running like the widget_test |
Did you set |
Yes I set nativeAutomation: true, please check the screen recording screen-recording-2023-06-28-at-44357-pm_JEO74Ltp.mp4 |
This looks like a problem with native setup - I've seen it a few times. Your tests do not run at all. Please run with |
Is there any resolution for this? |
Yes, you have to do the setup correctly. When one of the things is done wrong, such strange things happen and there's not much we can do about it. I need your Also, can you please show me the logs? |
I am getting this error if I am going to run with iOS simulators No device specified, using the first one (iPhone 14 Pro) |
MainActivityTest.java package com.paytronix.nexgenfl;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import pl.leancode.patrol.PatrolJUnitRunner;
@RunWith(Parameterized.class)
public class MainActivityTest {
@Parameters(name = "{0}")
public static Object[] testCases() {
PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation();
instrumentation.setUp(MainActivity.class);
instrumentation.waitForPatrolAppService();
return instrumentation.listDartTests();
}
public MainActivityTest(String dartTestName) {
this.dartTestName = dartTestName;
}
private final String dartTestName;
@Test
public void runDartTest() {
PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation();
instrumentation.runDartTest(dartTestName);
}
} path : /Users/lallu/Documents/GitHub/Next-Gen-App/android/app/src/main/java/com/paytronix/nexgenfl/MainActivityTest.java |
can you please provide me the resolution?. I have given the inputs you have asked for |
The Please also show
|
The logs are :
|
app/build.gradle def localProperties = new Properties() def flutterRoot = localProperties.getProperty('flutter.sdk') def flutterVersionCode = localProperties.getProperty('flutter.versionCode') def flutterVersionName = localProperties.getProperty('flutter.versionName') apply plugin: 'com.android.application' android {
} flutter { dependencies { |
command I am executing patrol test --target integration_test/example_test.dart patrol develop --target integration_test/example_test.dart |
Thanks a lot again. Your app has a flavor defined, and previously you called the command It's important to define flavor correctly. |
I have done that by adding flavor in my application, even i check with the flutter demo application. The tests are executing, completing and getting passed but its doing in background, not doing on device or simulator |
If I run with iOS I am facing different issue even I have mentioned above |
If you mean this - it's probably because you're not signed in into Xcode. |
Sorry but at this point I have no more ideas what might be wrong with your setup. I have to ask you to provide a minimal, reproducible sample so I can debug it locally. Ideally, create a new repo that I can just Patrol 2.0 is used extensively at my company and we don't have such problems. I'm pretty sure it's a setup issue. |
Okay we can check with the demo project setup which I have done |
Can I send you the flutter demo project compressed file that I have integrated patrol. If yes please provide me your email id |
Hi @lravihs, thank you for sending me the code. The problem is with your setup. Specifically, you put |
Thanks a lot @bartekpacia , the issues in android were cleared but I am getting this issue if I run on iOS device or simulator. Can you please help me in this.? lallu@Laliths-MacBook-Pro Next-Gen-App % patrol test --target integration_test/example_test.dart --flavor jk No device specified, using the first one (iPhone 14 Pro) |
This is a separate issue, so please create a new one. Also, check this: #1416 (comment) |
OKAY |
This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. |
Steps to reproduce
getting an error
Actual results
Exactly done the setup what are all the given in patrol 2.0 https://patrol.leancode.co/getting-started/native even after doing all these getting this error
Can anyone help me regarding this issue.?
Logs
Testing started at 1:26 pm ...
Running Gradle task 'assembleJkDebug'...
[jk:lib/assets/flavors/jk/app_settings.json]
flavorjk
Running Gradle task 'assembleJkDebug'... 14.4s
✓ Built build/app/outputs/flutter-apk/app-jk-debug.apk.
Installing build/app/outputs/flutter-apk/app-jk-debug.apk... 827ms
Patrol (native): packageName is not set. It's recommended to set it.
dart:core _AssertionError._throwNew
package:flutter/src/foundation/binding.dart 150:12 new BindingBase
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding&PaintingBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding&PaintingBinding&WidgetsBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding&PaintingBinding&WidgetsBinding&TestDefaultBinaryMessengerBinding
package:flutter_test/src/binding.dart new TestWidgetsFlutterBinding
package:flutter_test/src/binding.dart new LiveTestWidgetsFlutterBinding
package:integration_test/integration_test.dart new IntegrationTestWidgetsFlutterBinding
package:patrol/src/binding.dart new PatrolBinding
package:patrol/src/binding.dart 107:7 new PatrolBinding.ensureInitialized
package:patrol/src/common.dart 65:39 patrolTest
Users/lallu/Documents/GitHub/Next-Gen-App/integration_test/app_test.dart 56:3 main
Failed to load "/Users/lallu/Documents/GitHub/Next-Gen-App/integration_test/app_test.dart": 'package:flutter/src/foundation/binding.dart': Failed assertion: line 150 pos 12: '_debugInitializedType == null': Binding is already initialized to IntegrationTestWidgetsFlutterBinding
Patrol version
patrol:^2.0.0
Patrol Doctor output
Testing started at 1:26 pm ...
Running Gradle task 'assembleJkDebug'...
[jk:lib/assets/flavors/jk/app_settings.json]
flavorjk
Running Gradle task 'assembleJkDebug'... 14.4s
✓ Built build/app/outputs/flutter-apk/app-jk-debug.apk.
Installing build/app/outputs/flutter-apk/app-jk-debug.apk... 827ms
Patrol (native): packageName is not set. It's recommended to set it.
dart:core _AssertionError._throwNew
package:flutter/src/foundation/binding.dart 150:12 new BindingBase
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding&PaintingBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding&PaintingBinding&WidgetsBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding&PaintingBinding&WidgetsBinding&TestDefaultBinaryMessengerBinding
package:flutter_test/src/binding.dart new TestWidgetsFlutterBinding
package:flutter_test/src/binding.dart new LiveTestWidgetsFlutterBinding
package:integration_test/integration_test.dart new IntegrationTestWidgetsFlutterBinding
package:patrol/src/binding.dart new PatrolBinding
package:patrol/src/binding.dart 107:7 new PatrolBinding.ensureInitialized
package:patrol/src/common.dart 65:39 patrolTest
Users/lallu/Documents/GitHub/Next-Gen-App/integration_test/app_test.dart 56:3 main
Failed to load "/Users/lallu/Documents/GitHub/Next-Gen-App/integration_test/app_test.dart": 'package:flutter/src/foundation/binding.dart': Failed assertion: line 150 pos 12: '_debugInitializedType == null': Binding is already initialized to IntegrationTestWidgetsFlutterBinding
Flutter Doctor output
Testing started at 1:26 pm ...
Running Gradle task 'assembleJkDebug'...
[jk:lib/assets/flavors/jk/app_settings.json]
flavorjk
Running Gradle task 'assembleJkDebug'... 14.4s
✓ Built build/app/outputs/flutter-apk/app-jk-debug.apk.
Installing build/app/outputs/flutter-apk/app-jk-debug.apk... 827ms
Patrol (native): packageName is not set. It's recommended to set it.
dart:core _AssertionError._throwNew
package:flutter/src/foundation/binding.dart 150:12 new BindingBase
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding&PaintingBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding&PaintingBinding&WidgetsBinding
package:flutter_test/src/binding.dart new _TestWidgetsFlutterBinding&BindingBase&SchedulerBinding&ServicesBinding&GestureBinding&SemanticsBinding&RendererBinding&PaintingBinding&WidgetsBinding&TestDefaultBinaryMessengerBinding
package:flutter_test/src/binding.dart new TestWidgetsFlutterBinding
package:flutter_test/src/binding.dart new LiveTestWidgetsFlutterBinding
package:integration_test/integration_test.dart new IntegrationTestWidgetsFlutterBinding
package:patrol/src/binding.dart new PatrolBinding
package:patrol/src/binding.dart 107:7 new PatrolBinding.ensureInitialized
package:patrol/src/common.dart 65:39 patrolTest
Users/lallu/Documents/GitHub/Next-Gen-App/integration_test/app_test.dart 56:3 main
Failed to load "/Users/lallu/Documents/GitHub/Next-Gen-App/integration_test/app_test.dart": 'package:flutter/src/foundation/binding.dart': Failed assertion: line 150 pos 12: '_debugInitializedType == null': Binding is already initialized to IntegrationTestWidgetsFlutterBinding
The text was updated successfully, but these errors were encountered: