Commit graph

41 commits

Author SHA1 Message Date
Gray Mackall 286c73c0eb
Remove additional references to engine v1 android embedding (#146523)
https://github.com/flutter/engine/pull/51229 blocked [the roll](https://github.com/flutter/flutter/pull/146522) and had to be reverted, which is a shame, but on the bright side it made it possible to point the framework at my removal pr, at the point of its merging the first time 

This fixes all errors that are fixable in the framework that would have blocked the roll. There are some that aren't fixable here (they need to be fixed in the engine)*, so I'll fix those in the engine but unfortunately I can't pick up another version here to re-test until I try to roll again 😢 

*This category is: uses of plugins that in turn have a `registerWith`, that references the v1 embedding. The plan to fix these cases is to leave the interface that that method relies on around for now. See https://github.com/flutter/packages/pull/6494#issuecomment-2046010323 for details
2024-04-10 21:58:05 +00:00
Dan Field 835112de79
Use robolectric/AndroidJUnit4 for integration test tests (#144348)
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
```
2024-02-29 00:57:24 +00:00
Reid Baker a8e9f209a1
Update dependencies in integration test (#143111)
Update dependencies to latest versions
Related to #142618 
Fixes #143219

- [ x I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
2024-02-13 20:29:35 +00:00
Camille Simon 0650b76884
Revert "Migrate integration_test plugin to Gradle Kotlin DSL (#142008)" (#143329)
This reverts https://github.com/flutter/flutter/pull/142008 because it broke the Flutter --> packages roller.
2024-02-12 23:26:18 +00:00
Bartek Pacia 60f30a65b4
Migrate integration_test plugin to Gradle Kotlin DSL (#142008)
We already have a simple app in this repo that fully uses Gradle Kotlin DSL (see #141541). The next small step is to have at least one plugin that also uses Gradle Kotlin DSL. Let's use `integration_test` for that, since it's versioned with Flutter SDK.
2024-02-09 18:07:56 +00:00
Gray Mackall 120a01ccd2
Restore log dumps for gradle OOM crashes, and set a value for MaxMetaspaceSize (#143085)
Re-sets two jvmargs that were getting cleared because we set a value for `-Xmx`. Could help with https://github.com/flutter/flutter/issues/142957. Copied from comment here https://github.com/flutter/flutter/issues/142957:
>Two random things I ran into while looking into this that might help:
>
>1. Gradle has defaults for a couple of the jvmargs, and setting any one of them clears those defaults for the others (bug here https://github.com/gradle/gradle/issues/19750). This can cause the "Gradle daemon to consume more and more native memory until it crashes", though the bug typically has a different associated error. It seems worth it to re-set those defaults.
>2. There is a property we can set that will give us a heap dump on OOM ([-XX:HeapDumpOnOutOfMemoryError](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/clopts001.html))

Mostly just a find and replace from `find . -name gradle.properties -exec sed -i '' 's/\-Xmx4G/-Xmx4G\ \-XX:MaxMetaspaceSize=2G\ \-XX:+HeapDumpOnOutOfMemoryError/g' {} \;`, with the templates and the one test that writes from a string replaced by hand. I didn't set a value for `MaxMetaspaceSize` in the template files because I want to make sure this value doesn't cause problems in ci first (changes to the templates are essentially un-revertable for those who `flutter create` while the changes exist).
2024-02-07 19:25:39 +00:00
Zachary Anderson 6a6874ecf9
Update Android minSdkVersion to 21 (#142267)
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
2024-01-29 09:49:09 -08:00
Camille Simon c66bb0a18a
[Android] Support Android 34 (take 2) (#137967)
Re-lands https://github.com/flutter/flutter/pull/137191.

The fix for the issue causing that PR to be reverted was tested in this PR but ultimately landed separately in https://github.com/flutter/flutter/pull/138093.
2023-11-09 22:40:15 +00:00
Camille Simon 3215c492c8
[Android] Fix FlutterTestRunner.java deprecations (#138093)
Fixes deprecations causing unexpected standard error integration test failures: https://github.com/flutter/flutter/issues/138061, https://github.com/flutter/flutter/issues/138063, https://github.com/flutter/flutter/issues/138067, https://github.com/flutter/flutter/pull/138077.

Note that the issue this fixes was the same that was the cause for reverting https://github.com/flutter/flutter/pull/137191. I made this same fix in https://github.com/flutter/flutter/pull/137967 and changed `Mac_android run_release_test` to run in presubmit to see a successful run for proof that this fix works.
2023-11-08 21:10:48 +00:00
auto-submit[bot] c4ce9479bb
Reverts "[Android] Support Android 34" (#137865)
Reverts flutter/flutter#137191
Initiated by: camsim99
This change reverts the following previous change:
Original Description:
Adds support for Android 34 in the following ways:

- Bumps integration tests compile SDK versions 33 --> 34
- Bumps template compile SDK version 33 --> 34
- Also changes deprecated `compileSdkVersion` to `compileSdk`

Part of https://github.com/flutter/flutter/issues/134220
2023-11-03 20:14:19 +00:00
Camille Simon 675fec805a
[Android] Support Android 34 (#137191)
Adds support for Android 34 in the following ways:

- Bumps integration tests compile SDK versions 33 --> 34
- Bumps template compile SDK version 33 --> 34
- Also changes deprecated `compileSdkVersion` to `compileSdk`

Part of https://github.com/flutter/flutter/issues/134220
2023-11-02 22:18:11 +00:00
Zachary Anderson 4d5a1d91e1
Bump gradle heap size limit in *everywhere* (#134665)
I'm seeing these in the bot reports every week. Hopefully this is all of
them, and hopefully 4GB is enough.
2023-09-13 10:36:24 -07:00
Gray Mackall 827b5dff02
[integration_test] Allow capture of screenshots for FlutterFragmentActivitys (#132406)
Fixes https://github.com/flutter/flutter/issues/89683.

The changes to `getFlutterView` in `FlutterDeviceScreenshot` are the fix that was required, everything else was done to get tests running (such as re-generating some lockfiles and modifying the android manifest).

The code was all currently not unit tested, and there were no other easy examples to base these java unit tests off in flutter/flutter, so let me know if this approach to testing is wrong.
2023-09-07 22:32:48 +00:00
Reid Baker 9376a2ac60
Support minifcation for apps that depend on AGP 8 and integration_test (#127628)
- Set exported proguard rules for consumers of integration_test using AGP 8.0 
- Updated proguard usage in example to test setting custom proguard rules works.

#127388

Documentation for how consumerProguardFiles works. https://developer.android.com/studio/projects/android-library#Considerations

Unknown why we had to use ** instead of matching exactly.
2023-05-26 19:30:44 +00:00
Reid Baker 0fdddd67f9
Test AGP 8.0 using java 17 (#125323)
- Update Gradle/AGP version and add namespace plus dependencies. 

https://github.com/flutter/flutter/issues/125181
2023-05-08 15:02:31 +00:00
Reid Baker 3a6c4eb14d
Smallest change required to support host apps using agp 8.0 (#125657)
Testing AGP 8.0 is not possible with the existing infra because of the java version on CI machines. See https://github.com/flutter/flutter/issues/125325 for more details.

https://github.com/flutter/flutter/issues/125181
2023-04-28 14:30:46 +00:00
Dan Field fc20983686
Bump the default minSdkVersion to 19 (#125515)
See https://docs.flutter.dev/reference/supported-platforms

I don't expect this to break anything, but if it does we can revert and figure out what else needs to happen first.

Without this change, engine changes upstream will get flagged in default flutter created apps.
2023-04-27 17:26:28 +00:00
Zachary Anderson cc2a045c5a
Revert "[integration_test] upgrade androidx test to 1.4.0" (#124644)
Reverts flutter/flutter#122437

This is causing several Android devicelab tests to fail on the first
attempt, causing them to be marked flaky. The cause appears to be
unexpected output on stderr. See:
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64_android%20run_release_test/5390/overview
2023-04-11 18:54:59 -07:00
Micael Cid 4a83fa0fe9
[integration_test] upgrade androidx test to 1.4.0 (#122437)
[integration_test] upgrade androidx test to 1.4.0
2023-04-11 22:22:03 +00:00
Zachary Anderson 5fbc578e48
Revert "[integration_test] upgrade androidx test to 1.4.0 (#109547)" (#122106)
Revert "[integration_test] upgrade androidx test to 1.4.0"
2023-03-07 16:28:49 +00:00
Micael Cid 41fbf46b8c
[integration_test] upgrade androidx test to 1.4.0 (#109547)
[integration_test] upgrade androidx test to 1.4.0
2023-03-07 15:59:37 +00:00
Paul 16928037ad
Remove @param onDone (#113371)
Remove @param onDone
2023-03-01 00:27:43 +00:00
Lioness100 26b6c1bedd
Fix typos (#121171)
* Fix typos

* lowercase animated & opacity

* Undo typo fix

---------

Co-authored-by: Michael Goderbauer <goderbauer@google.com>
2023-02-23 19:43:21 +00:00
Andrei Diaconu 924336fcee
Reland 3: Display Features (#93240) 2021-11-20 15:48:06 -08:00
Zachary Anderson 2468f315e0
Revert "Reland: display features (#93117)" (#93204)
This reverts commit 9038fac960.
2021-11-06 22:46:46 -07:00
Andrei Diaconu 9038fac960
Reland: display features (#93117) 2021-11-05 15:54:25 -07:00
Zachary Anderson 7779ad3c60
Revert "Reland engine display features (#89511)" (#93098)
This reverts commit 058dfd49a0.
2021-11-04 23:05:45 -07:00
Andrei Diaconu 058dfd49a0
Reland engine display features (#89511) 2021-11-04 18:37:55 -07:00
Zachary Anderson 5188df0821
Revert gradle roll (#91459)
* Revert "Mark last failing test after gradle update as flaky. (#91423)"

This reverts commit 46a52d03bd.

* Revert "fix android template for Gradle 7 (#91411)"

This reverts commit 51d06d537f.

* Revert "Add explicit version for mac and windows openjdk. (#91408)"

This reverts commit bf429f2771.

* Revert "Update the openjdk version used by linux android tests. (#91405)"

This reverts commit 2144ab8b45.

* Revert "Migrate to Gradle 7.0.2 / AGP 7.0.1 (#90642)"

This reverts commit b6459f9b63.
2021-10-07 19:42:24 -07:00
Taha Tesser b6459f9b63
Migrate to Gradle 7.0.2 / AGP 7.0.1 (#90642) 2021-10-06 17:01:13 -07:00
Emmanuel Garcia a7f8687d23
Reland: Bump to Gradle 7 and use Open JDK 11 (#88540) 2021-08-20 09:57:02 -07:00
Emmanuel Garcia d39d542691
Revert "Reland: Bump to Gradle 7 and use Open JDK 11 (#88319)" (#88326)
This reverts commit b586695c82.
2021-08-16 20:38:32 -07:00
Emmanuel Garcia b586695c82
Reland: Bump to Gradle 7 and use Open JDK 11 (#88319)
* Bump to Gradle 7 and use Open JDK 11

* Add caches

* Fixes

* Remove org.gradle.java.home
2021-08-16 18:40:39 -07:00
Emmanuel Garcia 0504fac7e2
Android e2e screenshot (#84472) 2021-07-20 13:36:04 -07:00
Emmanuel Garcia fa5883b78e
Add Gradle lockfiles and tool to generate them (#83067) 2021-05-21 13:04:03 -07:00
Jonah Williams d9638d25d7
migrate from jcenter to mavencentral (#80908) 2021-04-21 21:41:07 -07:00
Emmanuel Garcia 42f21fd780
Standardize how Java8 is set in gradle files (#80600) 2021-04-19 20:19:03 -07:00
Emmanuel Garcia 8dd0de7f58
Relands: Migrate template to Gradle 6.7 and AGP 4.1.0 (#71446) 2020-12-01 19:01:09 -08:00
Amir Hardon 7df04fdbd3
Revert "Migrate template to Gradle 6.7 and AGP 4.1.0 (#70808)" (#71096)
This reverts commit 8e73bab94c.
2020-11-23 12:27:36 -08:00
Emmanuel Garcia 8e73bab94c
Migrate template to Gradle 6.7 and AGP 4.1.0 (#70808) 2020-11-20 13:05:35 -08:00
Dan Field 76784651d4
Move package:integration_test to flutter/flutter (#69622) 2020-11-05 17:28:47 -08:00