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

Remove Firebase dependancy and related code #874

Closed
wants to merge 1 commit into from
Closed

Remove Firebase dependancy and related code #874

wants to merge 1 commit into from

Conversation

kekkyojin
Copy link
Collaborator

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe: remove firebase dependancy

Fixes

Issue Number:

What is the current behavior?

LBRY depends on Firebase for building and running

What is the new behavior?

App no longer depends on Firebase and can be listed on F-Droid

Other information

This was a required change for LBRY to be listed on F-Droid

@kauffj
Copy link
Member

kauffj commented Mar 27, 2020

@kekkyojin I'm assuming this is in pursuit of https://lbry.tv/@lbrytech:19/lbrytech-android:5

This will need to be maintained as a fork of this project.

Alternatively, this code could be switched off as a build flag.

But either way this code will not be switched off in master, at least for now.

@kekkyojin
Copy link
Collaborator Author

Yes, it is for that reward.

Ok, so should I use my repository as the source code repository to get the app into F-Droid or will LBRY create another one?

@kauffj
Copy link
Member

kauffj commented Mar 27, 2020

@kekkyojin for now, we're asking you to fork the project and produce a repo that can produce an F-Droid valid build

we're still determining where this code will live long-term

this looks like a good start, and if you want to leave this open as a communication thread with us, that's fine as long as it's being actively worked on

@kekkyojin
Copy link
Collaborator Author

I am currently already trying to get the F-Droid to accept the app listing. Maybe I should leave this open until the app gets approved and then communicate through Discord or opening bug reports here when appropiate.

@kauffj
Copy link
Member

kauffj commented Apr 20, 2020

@kekkyojin any word from F-Droid?

@akinwale is doing a pretty substantial rewrite that may affect this.

@kekkyojin
Copy link
Collaborator Author

F-Droid is awaiting for me to get lbry-android-sdk being built from source. I have been trying to compile it, but it is not as simple. The easiest part has been to remove Firebase and related code. So whatever changes introduces @akinwale, those would be welcomed and quickly integrated. So proceed as needed, I will be able to integrate the changes into my forked repository, @kauffj.

My computer crashes when I untar de crystax-ndk on the Vagrant VM. I will keep trying to get it. Buildozer is already able to provide Python 3 compatibility on latest versions, which would remove the need to use that Crystax thing. I am also trying to use original Buildozer just to test if it works best.

Currently the main problem is getting lbry-android-sdk AARs which could then be copied into the /libs folder. Once it is solved, the merge into F-Droid would be fast.

@kauffj
Copy link
Member

kauffj commented May 5, 2020

@kekkyojin any progress on this?

@akinwale does this issue exist even with your new build? If so, Akin, can you do anything to allow kekkyojin to make progress on this?

@kekkyojin
Copy link
Collaborator Author

Right now it is locked because of Crystax NDK. They are providing Google's one and I tried to use it instead, but google's NDK doesn't include Python sources so the recipes on LBRY Android SDK cannot work and build stops there. I will try to get them to allow us to use Crystax NDK. @kauffj

As you are changing the code right now, I would be happier if Python code is removed, but as it doesn't seem the case according to your latest commits, could you at least try to use latest original Buildozer, @akinwale? Support for Python 3 was added some time after than when Buildozer was forked for LBRY.

@akinwale
Copy link
Contributor

akinwale commented May 6, 2020

I had assumed that providing a binary AAR of the Python build would've solved the problem of having to build from source. Apparently, the only pre-packaged binaries that are allowed to be used are the Google Android support library binaries (which is a bit ironic). If we published the AARs to Maven Central, will that solve the problem?

If you absolutely have to build the library from source, we could probably consider the alternative of hosting our own F-Droid repository? Looks like it should be possible based on https://f-droid.org/en/docs/FAQ_-_App_Developers/#can-i-run-my-own-f-droid-package-repository, but users will have to go through the extra step of adding the repository before they can actually download the app.

Switching the Python build from Crystax to Google's NDK may take a bit of time, and we don't have the bandwidth to do that right now.

@kekkyojin
Copy link
Collaborator Author

If we published the AARs to Maven Central, will that solve the problem?

According to the latest comment on the Merge Request i linked on previous comment, that could be enough. If you add the lbry-android-sdk to mavenCentral, I would use sed to edit the build.gradle so it gets it from the mavenCentral repository.

That could also help in getting other developers to build on the LBRY platform as they could add the AAR from a central respository instead of having to download and add manually the file to the project.

If you absolutely have to build the library from source,

That was what I was trying to do in order to add the app into F-Droid with the less amount of friction possible for the original repository.

Switching the Python build from Crystax to Google's NDK may take a bit of time, and we don't have the bandwidth to do that right now.

I agree.

@pluja
Copy link

pluja commented May 18, 2020

How's the progress with this? It is still being worked on? I think this is really important; at least having the option of opting out of Firebase Analytics.

@kauffj
Copy link
Member

kauffj commented May 18, 2020

This story definitely upped my concern that LBRY will see an issue.

With the admission that I'm parsing some things I may not understand fully, it sounds like the blocking step is to get lbry-android-sdk into mavenCentral.

Who can do that, @akinwale, @kekkyojin, or someone else?

@kekkyojin
Copy link
Collaborator Author

kekkyojin commented May 18, 2020

I expect someone at the LBRY team to add the AAR file to mavenCentral, @kauffj. That's because the file could be hosted there for both the official build and the F-Droid one.

@kauffj
Copy link
Member

kauffj commented May 19, 2020

@kekkyojin yes, @akinwale is working on this lbryio/lbry-android-sdk#6

@akinwale
Copy link
Contributor

@kekkyojin Can you take a look at https://bintray.com/lbryio/io.lbry.lbrysdk/lbry-android-sdk/v0.74.0 and let me know if it works for you?

@kekkyojin
Copy link
Collaborator Author

I have been trying to get Gradle to pick the lbry-sdk dependency, but I was unsuccessful. Could you change the repo to a Maven type, @akinwale? That way Bintray will generate the required metadata. I tried it by adding the repo to the project build.gradle and then adding the dependency to the app build.gradle.

Downloading files is not acceptable.

I am building app version 0.14.2, which uses 0.67.1 sdk version, I don't know if there are any incompatibilities.

@kekkyojin
Copy link
Collaborator Author

What is needed is for Gradle to get the library from the repository. F-Droid scans the application source code to see if it includes already compiled libraries, code which downloads compiled libraries or unknown repositories.

For example, 'yarn' downloads react-native required files and then uses its from the local repository. That is detected as "unknown repository" by the fdroid tool. In order to pass it, some build.gradle files should be skipped on-demand during the build.

F-Droid is permissive with those files, but all others should be downloaded from a recognized repository, like mavenCentral or the chosen Bintray.

Also, take notice that maven will only get one AAR from each artifact. Lbry is compiling into both 32 and 64 bits, which outputs the Python code into different files depending on the architecture. Most libraries don't have that problem, as they are intermediate Java binary code. I think LBRY should create two artifacts, one for the 32 bits code and another one for the 64 binary code fo the AAR library.

@kauffj
Copy link
Member

kauffj commented Jun 4, 2020

@akinwale can you leave a comment on what is blocking the AAR from making it into Maven, or when you expect this to happen?

@akinwale
Copy link
Contributor

akinwale commented Jun 4, 2020

I have been trying to get Gradle to pick the lbry-sdk dependency, but I was unsuccessful. Could you change the repo to a Maven type, @akinwale? That way Bintray will generate the required metadata. I tried it by adding the repo to the project build.gradle and then adding the dependency to the app build.gradle.

Downloading files is not acceptable.

I am building app version 0.14.2, which uses 0.67.1 sdk version, I don't know if there are any incompatibilities.

@kekkyojin I will look into the dependency and try to convert to Maven.

You may have to rebase on the latest master which gets rid of the React Native dependency, since it's a completely native build.

@akinwale
Copy link
Contributor

akinwale commented Jun 9, 2020

@kekkyojin I have updated the converted the bintray repo to Maven, so you should be able to add this now to the dependencies closure:

__32bitImplementation 'io.lbry:lbrysdk32:0.75.0'
__64bitImplementation 'io.lbry:lbrysdk64:0.75.0'

You may also have to add the repository to repositories (I've sent a request to add the repo to jcenter, so that this would no longer be necessary, but it looks like it may take a while).

maven { url  "https://dl.bintray.com/lbryio/io.lbry" }

@kekkyojin
Copy link
Collaborator Author

Excellent Akinwale @akinwale. I will be trying to build with needed changes today.

I have asked F-Droid team for a change in the LBRY repository URL so it points now to the lbry-android, instead. Whatever they reply, I will rebase the source code as you suggested so the first available version on F-Droid is the new Java native one. If they deny the change, I would just build the native one, bypassing the React Native folder. I no loner plan to build the React Native release.

@kauffj
Copy link
Member

kauffj commented Jun 10, 2020

Awesome @kekkyojin! Glad we got this back on track

@kekkyojin
Copy link
Collaborator Author

I have been able to build it on my local machines, both using Android Studio and the F-Droid tools. Thank you for doing the repository and dependency change yourself, @akinwale.

However, I am afraid that it will still require the JCenter hosted library, as the build only finished after I commanded it to ignore the build.gradle file, where the dl.bintray.com repository was introduced.

I have also updated the PR on GitLab so their server performs more tests. Some time today or tomorrow, their server would perform a build. But I am not expecting any other change from me or LBRY team.

@kauffj
Copy link
Member

kauffj commented Jun 11, 2020

Thanks for the update @kekkyojin

@akinwale
Copy link
Contributor

akinwale commented Jun 11, 2020

@kekkyojin Thanks for the update. I just got confirmation that the lbrysdk32 package has been added to JCenter. Waiting for an update on lbrysdk64.

@akinwale
Copy link
Contributor

lbrysdk64 is now in JCenter.

@akinwale
Copy link
Contributor

@kekkyojin Posted this on Discord too. I discovered that there seems to be a build failure with the package on F-Droid: https://f-droid.org/wiki/page/io.lbry.browser/lastbuild_15122

@kekkyojin
Copy link
Collaborator Author

kekkyojin commented Jun 20, 2020

The failed build is "expected", as they are making changes on the way NDK is setup on their server.

I planned to revert my script into using r21b, which could have built the app the first time. However, they are manually editing scripts to use r21d, the one I am currently using. Their bot which creates the scripts when detects a new version is also using r21d now. So that would not work.

If you look here you will see that builds are failing for any app which uses the NDK, even if it was r21d. Check for example https://f-droid.org/wiki/page/eu.faircode.email/lastbuild_1208. That's the same build error we are getting for LBRY. That build script was also edited by them to use NDK r21d.

So it is not an error on the script side, but on their own infrastructure. Bad time when I asked for the PR. One day before, and it would have built successfully.

The only think we can do is wait for it to be fixed.

@kekkyojin
Copy link
Collaborator Author

LBRY was finally built on FDroid build servers on Wednesday morning. The app is not yet available on FDroid app, but that's expected.

My build script was changed by FDroid package maintainers and that meant only 64 bits compilations would be available for 0.15.12. I have already requested the person who did the changes for an explanation.

I am already getting ready to offer the updated 0.15.13 release on FDroid, which would be the tagged 0.15.13 version on lbryio repo with previous changes. Right now my forked repo is already on sync with that tag, so code was correctly merged without conflicts, @akinwale.

I don't want to request the prize until both 64 and 32 bits of the app are available on FDroid.

@kekkyojin
Copy link
Collaborator Author

kekkyojin commented Jun 29, 2020

LBRY is now available on FDroid, although only the 64 bits version. My build script included also the 32 bits one,.but FDroid team removed it. I am still waiting for a reason .

The app must be actively searched on the app. It will return the LBRY app entry. The FDroid web doesn't show any result, though, and it will take a few days until it could appear on the front page of the app and as an item in 'Latest apps'.

Tomorrow I will get the 0.15.14 release ready and I will add it to the PR currently waiting to be merged, which includes the 0.15.13. It includes both 32 and 64 bits and a note for FDroid maintainers.

I have just been tested 0.15.12 installed from FDroid and everything is working as expected.

@kauffj
Copy link
Member

kauffj commented Jun 29, 2020

@kekkyojin fantastic!! We'd like to pay you the bounty for this. Can you email jeremy@lbry.com?

Additionally, can we be put in control of the .yaml file that controls F-Droid metadata?

@kekkyojin
Copy link
Collaborator Author

@kekkyojin fantastic!! We'd like to pay you the bounty for this. Can you email jeremy@lbry.com?

I have sent you the email, Jeremy. I use Yahoo as my provider, so you would need to check your Spam folder, as many times it is there where it ends.

Additionally, can we be put in control of the .yaml file that controls F-Droid metadata?

In the email I also have said that I could transfer my fdroiddata forked repository to someone specified by Jeremy -or whoever is in charge in LBRY-. That repository is where changes to the YAML file are stored. However, that file works in tandem with the app source code, as it must reference a tagged commit on LBRY source code.

If LBRY is requesting the control of that file, then I am also assuming the second part of the bounty -maintaining it for 1 year- has been cancelled. Just my thought.

@kauffj
Copy link
Member

kauffj commented Jun 30, 2020

Answering you over email momentarily but for anyone else, we're looking to continue to work with you @kekkyojin

@tzarebczan
Copy link
Contributor

@kekkyojin can you also let us know when the latest version + 32 bit are up on frdoid also?

@kekkyojin
Copy link
Collaborator Author

Yes. I am checking the avsilability of 32 bits builds multiple times a day.

Currently, both 0.15.13 and 0.15.14 are asked to be built for 32 and 64 bits on my latest script, @tzarebczan. FDroid is having new problems on their infrastructure. Although they are merging new updates, their build server is not working as it should.

I will comment here whenever a 32 bits is available on FDroid and also on the developers channel on LBRY's Discord.

@kauffj
Copy link
Member

kauffj commented Jul 6, 2020

@kekkyojin we're going to close this since it's not really an open PR. We can continue to communicate via email.

@kauffj kauffj closed this Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants