RetroShare / retroshare-mobile

Retroshare mobile phone client
23 stars 8 forks source link

Attempting to compile retroshare-mobile with latest flutter.... #25

Open defnax opened 3 years ago

defnax commented 3 years ago

Atempting to compile retroshare-mobile with latest flutter....

ayushkoli772 commented 7 months ago

I have kept record of errors that i faced and also their solutions so I will also update the installation guide in readme, incase changes are needed

I saw that that readme needs better instruction, i tried now after two years in readme is missed lots of howto to configure the Android studio i need recheck it again when you done, and improve readme more

If you want i can update the readme so that at least there wont be problem to set the project locally. For now you can ask me if you face some error, as i first need to think how to put how the errors were produced and how to solve it, inside readme

If you get error after flutter pub get because of old version of dependencies then it takes time to update manually instead use this command- flutter pub upgrade --major-versions

If you get error for retroshare_wrapper_api then fork the repository and update the dependencies inside pubspec.yaml of that repository and also update the link to repository

Also make sure that your AS version is 2023.3 or higher as its minimum requirement for latest flutter version

defnax commented 7 months ago

What are the errors? Maybe fix the import stuff? Like how described in the link? I think you need fix the errors till get compiled

ayushkoli772 commented 7 months ago

I was not able to go though them properly because i was doing migration but mostly were class not found or doesn't support.

I will see it as soon as i wake up tomorrow, its almost 1 am here so I was going to sleep.

I will update you about my progress :)

defnax commented 7 months ago

ok now back at home, here other readme that needs updated too i see something install depencies in docs i think i add this things but i forget everything :D https://retrosharedocs.readthedocs.io/en/latest/developer/retrosharemobile/#install-dependencies

image

ayushkoli772 commented 7 months ago

Installation of these dependencies is not mentioned in installation guide. Do we need to add them in readme?

And I also didnt knew about this so i have to install too

defnax commented 7 months ago

I dont know maybe not @Kumaravinash9 updated retroshare-mobile few month later now the wrapper is is in the yml file. I think outdated.

ayushkoli772 commented 7 months ago

Got it.

Should i make a PR to integrate V2 embeddings?

defnax commented 7 months ago

Yes please PR for all the fixes for V2 embedding and the rest of alle the changes what you did

defnax commented 7 months ago

When PR is there i can try to test it too, and need to prepare a fresh install with Android studio and flutter stuff.

ayushkoli772 commented 7 months ago

Yes i will do it now. Just got home from college. Actually its my first time doing PR so I will first see how to do it properly

defnax commented 7 months ago

you need only make own branch for your changes, then the prs is easy

ayushkoli772 commented 7 months ago

Should i select current branch as base branch for PR?

@defnax?

ayushkoli772 commented 7 months ago

Hello @defnax, while installing this repository locally i first forked it then cloned it. Now i have 2 options

  1. Either making pull request to this repository directly, for this i have created a develop branch
  2. Or make a pull request through my forked repo, in this we first need to select the branch we need to make PR to with 2 branches: a. master b. current. From this which branch is suitable for making PR?

Thank you :)

defnax commented 7 months ago

go on top here to Pull Requests then you see make a pullrequest , very easy it detects automaticly, only whne is there changes

defnax commented 7 months ago

im wondering your branch shows full changes not partly changes. i see no real changes in develop branch.

ayushkoli772 commented 7 months ago

im wondering your branch shows full changes not partly changes. i see no real changes in develop branch.

Sorry, I don't get what you are saying :(

For changes, they were mainly inside MainActivity.kt and AndroidManifest.xml

And also, the previous code was not that old so only few changes were needed

defnax commented 7 months ago

i see no changes on your branch develop, when creating a pr from your branch its shows nothing changed. normal i use github desktop i create a branch from master then i edit the new branch, after branch edit done i create pr.

defnax commented 7 months ago

i forked retroshare-mobile and created a branch for the changes image

and pushed the changes now it popups out the branch for PR image

i found only 3 files are changed or? created now the PR, check if the changes right: https://github.com/RetroShare/retroshare-mobile/pull/65

on your branch i saw over 166 files edited but that was no real changes i think normaly a edited branch and a PR must look clean, where you see clear whats changed

ayushkoli772 commented 7 months ago

Got it. It was my mistake.

Maybe, what happened was while i was cloning the forked repo locally the internet bandwidth was very low so using git clone it was getting interrupted. So to avoid this i installed the repo locally by downloading zip of repo.

These were the steps i followed-

  1. git remote add origin ....
  2. git checkout -b develop
  3. git add .
  4. git commit -m ""
  5. git push origin develop

Maybe because of this all the files were updated on forked repo instead of just the files we did changes.

Also i was not using github desktop till now so from now on I will use it

defnax commented 7 months ago

Maybe you can make a clean new branch for the right changes, Im not sure if the 3 files are right what i found from your develop branch. its your choice what you want use, in github desktop i see what files i edited and which files i will commit to branch.

ayushkoli772 commented 7 months ago

Got it. I have cloned the forked repository using github desktop and done changes to that.

I will do PR as soon as i get home :)

ayushkoli772 commented 7 months ago

Hello @defnax, please check the PR. I only did the V2 embeddings and no other changes because i created a fresh fork repo and then only did these changes :)

I hope i didnt messed anything this time :|

defnax commented 7 months ago

its clean now, but you has tested it? compile retroshare-mobile clean and running?

ayushkoli772 commented 7 months ago

No, this is just for V2 embeddings. The changes for clean and running retroshare is not in PR as Im still working on it, because i had to start from fresh new repo.

ayushkoli772 commented 7 months ago

To run RS mobile locally for debugging what steps should i follow? Just run 'main.dart'? or some setup is required?

defnax commented 7 months ago

yes run with main.dart i had no success need to prepar my android studio and sdk to get run

defnax commented 7 months ago

but i forget everything how i did, i never maked a apk, but i run in android studio retroshare-mobile run or debug in Android Studio

ayushkoli772 commented 7 months ago

yes run with main.dart i had no success need to prepar my android studio and sdk to get run

Yes same, in installation guide it says install service apk, I dont know what that is

defnax commented 7 months ago

that is the service apk but for the retroshare mobile apk, @Kumaravinash9 created a latest its required for retroshare-mobile apk https://github.com/RetroShare/retroshare-mobile/tree/master/android/app/retroshare-service-apks

maybe that needs again a new one too

ayushkoli772 commented 7 months ago

So this is for directly running the app? And not necessary for debugging right?

defnax commented 7 months ago

So this is for directly running the app? And not necessary for debugging right?

i dnow know about the service apk, but i used only testing the apk is outdated i think.

ayushkoli772 commented 7 months ago

Until then i will start fixing the errors to compile the code

defnax commented 7 months ago

i think retroshare-service.apk is compiled from this source https://github.com/RetroShare/RetroShare/commits/master/retroshare-service

G10h4ck commented 7 months ago

You should not use retroshare-service anymore but bundle libretroshare as an android library directly, look at how elrepo.io does it https://gitlab.com/elRepo.io/elRepo.io-android/-/blob/develop/android/app/build.gradle?ref_type=heads#L120 libretroshare build for android can be found in gitlab CI artifacts https://gitlab.com/RetroShare/libretroshare/-/pipelines/1146212385 AFAIR elRepo.io uses gradle to automatically depends on the published artifacts so better looking at elRepo.io gradle files

defnax commented 7 months ago

@ayushkoli772 my flutter and new android studio installed, but doesnt get to work with dart sdk, image image

In Settings for Dart or Flutter SDK path it wont use the path image

how you solved this? i solved with dart it was image

ok seems i solved it but sdk path not able to set in flutter settings

image

ayushkoli772 commented 7 months ago

Dont give path of flutter\bin in for flutter sdk, just until ...-stable\flutter as it is the sdk path to flutter directory. Like this in my case-

image

I havent done any changes to dart sdk path as once you properly select flutter sdk path i think it auto configures

image

Also there might be error arise after doing this, something like git not found for path so you have to add the directory to safe directory list of git

Regarding resolving errors- The errors in codebase are easily fixable as the previous code was not null safe and now we just have to make it null safe with few changes. Even though there are many errors in multiple files it won't take much time. I have almost resolved half errors, will continue once i get home from college :)

defnax commented 7 months ago

Okey @ayushkoli772, @ like @G10h4ck said retroshare service doesnt needed more, maybe when everything fine and solved in code and retroshare mobile running to attempt to implement what gio said.

defnax commented 7 months ago

@ayushkoli772 you add on lots of places ,

thats changes are right? i remember in the past that maked issues

image

ayushkoli772 commented 7 months ago

@ayushkoli772 you add on lots of places ,

thats changes are right? i remember in the past that maked issues

image

Yes. But not all errors are resolved yet, im working on it

ayushkoli772 commented 7 months ago

Hello @defnax, on my develop branch the code is errorless. Now i want to compile and test run the code to make sure the app is properly running and also for debugging.

Now i tried compiling the app but its giving many errors for 'package:retroshare_api_wrapper/src/rsModels.dart'. I think it needs changes too

defnax commented 7 months ago

ther is to much errors? i doesnt thinked that flutter change makes so much errors, in the run tab i see lots of errors, i had never so much with old rs mobile :) image

you run from here too or? image

defnax commented 7 months ago

when need some input if usefull for the retroshare wrapper, from elrepo project https://gitlab.com/elRepo.io/retroshare-wrapper-dart https://gitlab.com/elRepo.io/elRepo.io-android

https://gitlab.com/elRepo.io/elRepo.io-android/-/blob/develop/android/app/build.gradle?ref_type=heads#L120 https://gitlab.com/RetroShare/libretroshare/-/pipelines/1146212385

ayushkoli772 commented 7 months ago

ther is to much errors? i doesnt thinked that flutter change makes so much errors, in the run tab i see lots of errors, i had never so much with old rs mobile :) image

you run from here too or? image

Yes, I run it from Chrome web.

But as you can see it says that this app is not configured to build on web so im going to try usb debugging or some other method just to make sure the error is in code not due to what device we are trying to run in

defnax commented 7 months ago

you get solved more issues? hope anytime is fixed all

ayushkoli772 commented 7 months ago

you get solved more issues? hope anytime is fixed all

Not much progress today. I didnt got time because of some work but Im planning to solve till this Monday. I hope it does :)

defnax commented 7 months ago

hi i has started to improved readme, look if i missed something, need to update the docs page own readme too

defnax commented 7 months ago

this i think not more needed right https://retrosharedocs.readthedocs.io/en/latest/developer/retrosharemobile/ image

ayushkoli772 commented 7 months ago

hi i has started to improved readme, look if i missed something, need to update the docs page own readme too

Im not sure but I think for flutter commands to work, git is one of the requirements so i think along with github desktop, git CLI should also be installed. It wont affect anything even if we install git but maybe it can if its not installed.

image

defnax commented 7 months ago

any news about fix the issues?

ayushkoli772 commented 7 months ago

Tried few changes but still error remain. I didn't pushed the recent changes unless all are solved.