1. 29 Feb, 2024 1 commit
    • Dan Field's avatar
      Use robolectric/AndroidJUnit4 for integration test tests (#144348) · 835112de
      Dan Field authored
      This allows relanding https://github.com/flutter/engine/pull/51056. The patch introduced a change where a static member is initialized from `View.generateViewId()` instead of conditionally using that API. Without an implementation for that in android.jar, the test will fail. The test in here currently is using a fake implementation that creates errors seen below.
      
      See https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8754827734484522225/+/u/run_plugin_test/stdout#L46564_2 for failure. More detailed failure information is available locally in the `build` folder:
      
      ```
      Mockito cannot mock this class: class io.flutter.embedding.android.FlutterActivity.
      
      If you're not sure why you're getting this error, please open an issue on GitHub.
      
      Java               : 17
      JVM vendor name    : JetBrains s.r.o.
      JVM vendor version : 17.0.7+0-17.0.7b1000.6-10550314
      JVM name           : OpenJDK 64-Bit Server VM
      JVM version        : 17.0.7+0-17.0.7b1000.6-10550314
      JVM info           : mixed mode
      OS name            : Mac OS X
      OS version         : 14.3.1
      
      You are seeing this disclaimer because Mockito is configured to create inlined mocks.
      You can learn about inline mocks and their limitations under item #39 of the Mockito class javadoc.
      
      Underlying exception : org.mockito.exceptions.base.MockitoException: Cannot instrument class io.flutter.embedding.android.FlutterActivity because it or one of its supertypes could not be initialized
      	at app//dev.flutter.plugins.integration_test.FlutterDeviceScreenshotTest.getFlutterView_returnsFlutterViewForFlutterActivity(FlutterDeviceScreenshotTest.java:32)
      	at java.base@17.0.7/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base@17.0.7/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      	at java.base@17.0.7/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.base@17.0.7/java.lang.reflect.Method.invoke(Unknown Source)
      	at app//org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
      	at app//org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at app//org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
      	at app//org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at app//org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      	at app//org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
      	at app//org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
      	at app//org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
      	at app//org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
      	at app//org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
      	at app//org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
      	at app//org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
      	at app//org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
      	at app//org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
      	at app//org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      	at app//org.junit.runners.ParentRunner.run(ParentRunner.java:413)
      	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
      	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
      	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
      	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
      	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
      	at java.base@17.0.7/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base@17.0.7/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      	at java.base@17.0.7/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.base@17.0.7/java.lang.reflect.Method.invoke(Unknown Source)
      	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
      	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
      	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
      	at jdk.proxy1/jdk.proxy1.$Proxy2.processTestClass(Unknown Source)
      	at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
      	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
      	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
      	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
      	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
      	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:133)
      	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
      	at app//worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
      	at app//worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
      Caused by: org.mockito.exceptions.base.MockitoException: Cannot instrument class io.flutter.embedding.android.FlutterActivity because it or one of its supertypes could not be initialized
      	at app//net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:168)
      	at app//net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:399)
      	at app//net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:190)
      	at app//net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:410)
      	... 44 more
      Caused by: java.lang.RuntimeException: Method generateViewId in android.view.View not mocked. See http://g.co/androidstudio/not-mocked for details.
      	at android.view.View.generateViewId(View.java)
      	at io.flutter.embedding.android.FlutterActivity.<clinit>(FlutterActivity.java:218)
      	at java.base/java.lang.Class.forName0(Native Method)
      	at java.base/java.lang.Class.forName(Unknown Source)
      	at org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.assureInitialization(InlineBytecodeGenerator.java:236)
      	at org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.triggerRetransformation(InlineBytecodeGenerator.java:261)
      	at org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.mockClass(InlineBytecodeGenerator.java:218)
      	at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.lambda$mockClass$0(TypeCachingBytecodeGenerator.java:47)
      	at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:168)
      	at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:399)
      	at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:190)
      	at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:410)
      	at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.mockClass(TypeCachingBytecodeGenerator.java:40)
      	at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.createMockType(InlineDelegateByteBuddyMockMaker.java:396)
      	at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.doCreateMock(InlineDelegateByteBuddyMockMaker.java:355)
      	at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.createMock(InlineDelegateByteBuddyMockMaker.java:334)
      	at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.createMock(InlineByteBuddyMockMaker.java:56)
      	at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:99)
      	at org.mockito.internal.MockitoCore.mock(MockitoCore.java:88)
      	at org.mockito.Mockito.mock(Mockito.java:2087)
      	at org.mockito.Mockito.mock(Mockito.java:2002)
      	... 44 more
      ```
      835112de
  2. 13 Feb, 2024 1 commit
  3. 12 Feb, 2024 2 commits
  4. 09 Feb, 2024 3 commits
  5. 08 Feb, 2024 1 commit
  6. 07 Feb, 2024 1 commit
  7. 04 Feb, 2024 2 commits
  8. 01 Feb, 2024 1 commit
  9. 29 Jan, 2024 1 commit
    • Zachary Anderson's avatar
      Update Android minSdkVersion to 21 (#142267) · 6a6874ec
      Zachary Anderson authored
      This PR increases Android's `minSdkVersion` to 21.
      
      There are two changes in this PR aside from simply increasing the number
      from 19 to 21 everywhere.
      
      First, tests using `flutter_gallery` fail without updating the
      lockfiles. The changes in the PR are the results of running
      `dev/tools/bin/generate_gradle_lockfiles.dart` on that app.
      
      Second, from
      [here](https://developer.android.com/build/multidex#mdex-pre-l):
      > if your minSdkVersion is 21 or higher, multidex is enabled by default
      and you don't need the multidex library.
      
      As a result, the `multidex` option everywhere is obsolete. This PR
      removes all logic and tests related to that option that I could find.
      `Google testing` and `customer_tests` pass on this PR, so it seems like
      this won't be too breaking if it is at all. If needed I'll give this
      some time to bake in the framework before landing the flutter/engine
      PRs.
      
      Context: https://github.com/flutter/flutter/issues/138117,
      https://github.com/flutter/flutter/issues/141277, b/319373605
      6a6874ec
  10. 24 Jan, 2024 1 commit
  11. 19 Jan, 2024 1 commit
  12. 12 Jan, 2024 2 commits
  13. 09 Jan, 2024 1 commit
  14. 05 Jan, 2024 1 commit
  15. 04 Jan, 2024 1 commit
  16. 03 Jan, 2024 2 commits
  17. 02 Jan, 2024 3 commits
  18. 20 Dec, 2023 1 commit
  19. 19 Dec, 2023 1 commit
  20. 15 Dec, 2023 3 commits
  21. 06 Dec, 2023 1 commit
  22. 15 Nov, 2023 1 commit
    • Srujan Gaddam's avatar
      Pin package:web 0.4.0 (#138428) · d8ffc739
      Srujan Gaddam authored
      This version is needed so that dart:js_interop can move to extension
      types. Also adds some code to handle some breaking changes:
      
      - Body -> Response. Body was an IDL interface mixin type we exposed in
      dart:html. Going forward, users should either use Request or Response.
      - Casts to JSAny. These are temporary until we move package:web types to
      extension types. Currently, package:web types can't implement JSObject
      as JSObject will move to be an extension type itself.
      Co-authored-by: 's avatarKevin Moore <kevmoo@users.noreply.github.com>
      d8ffc739
  23. 13 Nov, 2023 1 commit
  24. 09 Nov, 2023 1 commit
  25. 08 Nov, 2023 1 commit
  26. 03 Nov, 2023 2 commits
  27. 02 Nov, 2023 1 commit
  28. 01 Nov, 2023 1 commit
  29. 31 Oct, 2023 1 commit