Skip to content
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

"minSdkVersion [29] > deviceApiLevel [24]" error when trying to use GitHub actions build the app #5235

Closed
mnalis opened this issue Jun 15, 2023 · 6 comments
Labels

Comments

@mnalis
Copy link
Contributor

mnalis commented Jun 15, 2023

Summary

Trying to compile the app using included GitGub action Android CI fails.

Steps to reproduce

  • Forked the apps-android-commons repo
  • try to use Android CI GitHub action to build the app
  • notice it fails with an error

Expected behaviour

App builds successfuly

Actual behaviour

the build fails with:

w: /home/runner/work/apps-android-commons/apps-android-commons/app/src/androidTest/java/fr/free/nrw/commons/WelcomeActivityTest.kt: (12, 27): 'ActivityTestRule<T : Activity!>' is deprecated. Deprecated in Java
w: /home/runner/work/apps-android-commons/apps-android-commons/app/src/androidTest/java/fr/free/nrw/commons/WelcomeActivityTest.kt: (27, 23): 'ActivityTestRule<T : Activity!>' is deprecated. Deprecated in Java
w: /home/runner/work/apps-android-commons/apps-android-commons/app/src/androidTest/java/fr/free/nrw/commons/WelcomeActivityTest.kt: (27, 45): 'ActivityTestRule<T : Activity!>' is deprecated. Deprecated in Java
w: /home/runner/work/apps-android-commons/apps-android-commons/app/src/androidTest/java/fr/free/nrw/commons/util/MyViewAction.kt: (46, 38): Parameter 'position' is never used

> Task :app:compileBetaDebugAndroidTestJavaWithJavac
> Task :app:dexBuilderBetaDebugAndroidTest
> Task :app:mergeBetaDebugAndroidTestJavaResource
> Task :app:mergeProjectDexBetaDebugAndroidTest
> Task :app:packageBetaDebugAndroidTest

> Task :app:connectedBetaDebugAndroidTest FAILED
Skipping device 'test(AVD) - 7.0' for 'app:BETA': minSdkVersion [29] > deviceApiLevel [24]

BETA > : No compatible devices connected.[TestRunner] FAILED 
Found 1 connected device(s), 0 of which were compatible.

FAILURE: Build failed with an exception.

it also fails in upstream repo, e.g. https://github.com/commons-app/apps-android-commons/actions/runs/5278007589/jobs/9546773502

Device name

n/a

Android version

n/a

Commons app version

latest (post-4.1.0) master 231b96d

Device logs

No response

Screen-shots

No response

Would you like to work on the issue?

None

@mnalis mnalis added the bug label Jun 15, 2023
@mnalis
Copy link
Contributor Author

mnalis commented Jun 15, 2023

Possibly related issues: #5175, #5223, #5226, #5228

@mnalis
Copy link
Contributor Author

mnalis commented Jun 15, 2023

It seems to last have worked on 27. Apr 2023, in this run: https://github.com/commons-app/apps-android-commons/actions/runs/4818991911 based on commit 48e4c40.

Next run https://github.com/commons-app/apps-android-commons/actions/runs/4844652141 based on commit 1649d1e (and all runs which ran afterward) seem to fail.

So if I'm correct, problematic commit might be this one by @sivaraam: 0f0358f, which bumped minSdkVersion from 21 to 29 (but didn't bump deviceApiLevel?)

@sivaraam
Copy link
Member

Yes @mnalis. Reducing the minSdk was planned as a fix for the CI failure. I've raised an MR to do the same [#5236] which should hopefully bring the CI runs back to normal.

@mnalis
Copy link
Contributor Author

mnalis commented Jun 16, 2023

Thanks @sivaraam it indeed proceeds further now, although it still fails for me with different errors:

> Task :app:packageBetaDebugAndroidTest
> Task :app:connectedBetaDebugAndroidTest
Starting 41 tests on test(AVD) - 7.0

fr.free.nrw.commons.AboutActivityTest > testLaunchFacebook[test(AVD) - 7.0] FAILED 
	androidx.test.espresso.base.RootViewPicker$RootViewWithoutFocusException: Waited for the root of the view hierarchy to have window focus and not request layout for 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Root:
	Root{application-window-token=android.view.ViewRootImpl$W@be181a8, window-token=android.view.ViewRootImpl$W@be181a8, has-window-focus=false, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) sim=#100 ty=1 fl=#81010100 pfl=0x20000 wanim=0x1030465 needsMenuKey=2}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=320, height=640, has-focus=true, has-focusable=true, has-window-focus=false, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=WM.LayoutParams{(0,0)(fillxfill) sim=#100 ty=1 fl=#81010100 pfl=0x20000 wanim=0x1030465 needsMenuKey=2}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}}

fr.free.nrw.commons.AboutActivityTest > testLaunchAboutFaq[test(AVD) - 7.0] FAILED 
	androidx.test.espresso.base.RootViewPicker$RootViewWithoutFocusException: Waited for the root of the view hierarchy to have window focus and not request layout for 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Root:
	Root{application-window-token=android.view.ViewRootImpl$W@a6da4fe, window-token=android.view.ViewRootImpl$W@a6da4fe, has-window-focus=false, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) sim=#100 ty=1 fl=#81010100 pfl=0x20000 wanim=0x1030465 needsMenuKey=2}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=320, height=640, has-focus=true, has-focusable=true, has-window-focus=false, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=WM.LayoutParams{(0,0)(fillxfill) sim=#100 ty=1 fl=#81010100 pfl=0x20000 wanim=0x1030465 needsMenuKey=2}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}}

[...]

But the original SDK version problem at least seems to be resolved; I'll open a new issue for this new problem...

@sivaraam
Copy link
Member

@mnalis That's strange. The unit tests run without issues in the master branch of this repo [latest run].

Could you kindly check if this is just a one-off issue by re-running the pipeline ? Also, merging the latest changes is a good thing too since there was a fix for a unit test failure.

@mnalis
Copy link
Contributor Author

mnalis commented Jun 20, 2023

@sivaraam yes, I've run it on latest master. It fails majority of the times, but just as I was going to respond that it always fails, it finally succeeded (without any changes - just brute-forcing run after run !!) on 12th run.

I've opened this issue #5245; it would be much appreciated if you'd like to take a look there.

@mnalis mnalis closed this as completed Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants