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

Update tool versions and ensure smooth build #37

Closed
ajburley opened this issue Jul 15, 2019 · 4 comments
Closed

Update tool versions and ensure smooth build #37

ajburley opened this issue Jul 15, 2019 · 4 comments
Assignees
Labels
closed-as-implemented This feature or documentation request has now been implemented, so is being closed. enhancement New feature or request
Milestone

Comments

@ajburley
Copy link
Collaborator

ajburley commented Jul 15, 2019

Some versions are hard-coded. Update to the latest versions of tools (Gradle, Android SDK Tools etc) and ensure (a) the project still builds, (b) it builds smoothly, in-line with current best practices. This should be done with the latest version of Android Studio.

Note that this does not include upgrading the SDK version overall - see #43 for that.

EDIT: If cardslib is not removed under this issue, we need to create another issue to remove cardslib eventually.

@ajburley
Copy link
Collaborator Author

After upgrading the Gradle plugin version to 3.4.2 these were the immediate actions:

ERROR: Failed to resolve: com.android.support:support-v4:25.1.1
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: Sealnote, aFileChooser


ERROR: Failed to resolve: com.android.support:support-v4:19.0.+
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: Sealnote


ERROR: The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
Remove minSdkVersion and sync project
Affected Modules: aFileChooser


WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: Sealnote, aFileChooser


WARNING: The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.2.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Remove Build Tools version and sync project
Affected Modules: Sealnote, aFileChooser

@ajburley
Copy link
Collaborator Author

ajburley commented Jul 16, 2019

Okay, this has got a lot more complicated than I first imagined.

Both cardslib and sdk-manager-plugin are no longer maintained. For now I am hoping I can still use them in the short term, as I just want to get something which builds and then move on to the long term future. The docs for sdk-manager-plugin itself are saying that it's no longer needed after Gradle plugin version 2.2.0, but cardslib 1.6.0 is using Gradle Plugin version 0.10.x. Nevertheless, using SDK Manager is going to require the "android" tool, which would require going back to an old version of the Android SDK, exactly what I'm trying to avoid in this ticket.

It seems like the options are:

  1. Completely fork cardslib and set up a new build environment with the old version of Android SDK to build it into the local repository and then use it in SealNote Plus (which can continue to use the later version of the SDK).
  2. Move away from cardslib.
  3. Upgrade cardslib to the latest Gradle plugin version as well, and remove SDK Manager.

I want to avoid option 1 for now, because this would also require everyone else to do the same thing if they wanted to build SealNote Plus from source. Option 2 is a long term goal, but will probably require massive changes to the UI, which is not very practical when (in the short term) you can't even build what you have. So I am going to try with option 3 and see how far I can get.

@ajburley
Copy link
Collaborator Author

ajburley commented Jul 16, 2019

I used the directory names as module names: "library" and "library-extra".

Initial sync with 3.4.2:

ERROR: The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
Remove minSdkVersion and sync project
Affected Modules: library, library-extra


WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: library-extra


WARNING: The specified Android SDK Build Tools version (19.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.2.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '19.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Remove Build Tools version and sync project
Affected Modules: library, library-extra


WARNING: The targetSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
Remove targetSdkVersion and sync project
Affected Modules: library, library-extra

Someone else has seemingly fixed the cardslib build issues: oplarshad/cardslib@ef39a99

But they applied their changes on top of HEAD, whereas we are on 1.6.0. Still, their commit is useful for reference.

@ajburley ajburley added this to the Release 0.9 milestone Jul 17, 2019
@ajburley ajburley added the closed-as-implemented This feature or documentation request has now been implemented, so is being closed. label Jul 17, 2019
@ajburley
Copy link
Collaborator Author

After resolving the above items, it works smoothly, and behaviour seems fine on Android 7.1.1 (which was the latest tested in legacy; there are known issues with Android 8.0 which we will fix in the near future). There are still many items from oplarshad/cardslib@ef39a99 we have not implemented; I will create another issue to see whether these are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-as-implemented This feature or documentation request has now been implemented, so is being closed. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant