AW5th / MBM-March

3/5/2021
0 stars 0 forks source link

Record user selection of genres in database #7

Open aratton opened 3 years ago

sinene commented 3 years ago

-Created new DynamoDB Data Source in AWS App Sync called Genre_Test -Made button to load the data into DynamoDB (will have to create functions)

sinene commented 3 years ago

-Attempted to send genreObject to backend by making a mock "EDM" button but received an "CognitoUserSession is not valid because idToken is null." error from Cognito meaning even though we are signed into an account datastore is not recognizing the user's id(auth issue)

SOLUTION: -Deleted amplify folder, attempted pull again -Did not get "This app is not valid or was deleted.", got "Successfully logged into Amplify Admin UI."

-Login broke because it was trying to pull from the old back end SOLUTION: deleted old duplicate amplifyconfiguration.dart files and instead of each page having it's own dart file, all pages that use amplify services will import from a single file(import 'package:flutter_app_two/amplifyconfiguration.dart';)

GENRE BUTTON INFO When "EDM" button is press, "create()" is called which should creates a edm genreObject in the storage of the signed in user if genres wanted to be pulled from user, should return an array of strings containing which genres the user selected Current issue: When tapping "EDM" button receiving " DataStore plugin not added correctly" -Forums say it has something to do with the podfile (will look into it)

nickowalcz commented 3 years ago

-Issues: Unable to run emu lator despite running vysor and no visible errors the application will just build for hours and not run

-Progress Implemented read,update,and delete functions for objects in the backend, will push tomorrow if no work is conflicting

sinene commented 3 years ago

Cleaning up errors(renaming objects) because we're trying to use the new Genre.dart as a data models instead of GenreObject.dart(Genre.dart has a more relevant configuration(genreList) for relating to the task(making genre buttons that reflects what genres the user likes) than the initial "genre object" made - 5:40pm

-Genre.dart has genre as a list of strings rather than a single string so multiple genres can be selected per user

Updated 'create' function to add genre as a string to genre list -6:00 - 6:58

Still getting the: I/flutter (15517): DataStore plugin not added correctly

nickowalcz commented 3 years ago

Still having problems running the emulator through vysor. I can see the loading page and got the create account button to work only once otherwise it is non responsive. Will look into other emulator software tomorrow

Backend "edm" genre is not being communicated, error "DataStore plugin not added correctly", hopefully can be resolved with: "dataStore": { "plugins": { "awsDataStorePlugin": { "syncMode": "api", "apiName": "amplifyDatasource" } } },

nickowalcz commented 3 years ago

hours: monday + tuesday = 3h 11m

nickowalcz commented 3 years ago

Got the emulator working

Tried syncing data from app to aws with no luck yet

Checked the amplifyconfig file and dsicovered that datastore was actually missing from the config file for some reason which is most likely cause for the data "DataStore plugin not added correctly"

Solution: Manually add the datastore configurations 2 h

nickowalcz commented 3 years ago

4:00 pm Attempting to follow Adam Cyber storage tutorial and implement file upload and see if we can get something transferred by the end of today https://dev.to/thatflutterdude/flutter-apps-with-aws-amplify-backend-part-4-storage-3cpm

4:15 noticed unused function _configureAamplify() async, added function call @override void intiState(){ super.initState(); _configureAmplify(); }

No luck, unable to upload photos or initialize s3 storage 1h 21 min

nickowalcz commented 3 years ago

4:20 Persisting issue "CognitoUserSession is not valid because idToken is null", will need to look into it

5:28 Back end environment not connected to admin console. Found solution by changing AmplifyAppId to app id found in aws amplify console UI.

6:17 Found solution to Datastore plugin not found, "Amplify.DataStore.addPlugin(dataStorePlugin);"

1h

sinene commented 3 years ago

(MAJOR HOLD UP) - 5/3/2021-5/6/2021: Andriod studio is taking an unreasonable amount of time to run gradle and launch the app on my phone (2-3 hours at a time just to launch) just for the app to freeze up to the point where it's unusable when it finally opens up on my phone.

Solution: I will edit the project on the 'ASOP from IA Emulator' for Pixel 2 from now on. It still takes an extremely long time to launch but the app doesn't freeze up to the point where every click I make causes a 3-5min freeze up.

sinene commented 3 years ago

7:03pm - (before starting) Installed android studio on another laptop that can run it faster

7:10pm - Deleted extra API and remodels the data source

7:25pm - 8:13pm - Created new data source called "user" to replace genre, and genre object(were not necessary), plan to store genres as one of it's attributes ArtistType, Style, and Genre array(for now) Pull and connected backend locally again added storage and analytics pushed changes to the backend(everyone should use amplify pull to update their local projects, check Reference)

8:25pm - Error: Failed to install the following Android SDK packages as some licenses have not been accepted. Tried: Copying licenses to source folder Error: Failed to install the following Android SDK packages as some licenses have not been accepted. build-tools;28.0.3 Android SDK Build-Tools 28.0.3 platforms;android-28 Android SDK Platform 28 image.png Tried: ran "flutter doctor --android-licenses" to accept licenses WORKED

8:45pm - Error: Execution failed for task ':amplify_auth_cognito:compileDebugKotlin'.

Kotlin could not find the required JDK tools in the Java installation 'C:\Program Files\Java\jre1.8.0_291' used by Gradle. Make sure Gradle is running on a JDK, not JRE. Tried: Adding this to gradle.properties: org.gradle.java.home=C:\Program Files\Java\jdk1.8.0_91 Error: Value 'C:\Program Files\Java\jdk1.8.0_91' given for org.gradle.java.home Gradle property is invalid (Java home supplied is invalid) Tried: Went to oracle website and reinstalled jdk1.8.0_91 WORKED

9:12pm-12:00am Goal: Locate broken upload page and use it as a template for functioning upload page(user storage implementation) Add gesture detector to upload button to redirect to the page

Copied code from "BackButtonOnProfile.dart" to "Profile.dart" and deleted file added GestureDetector to the back button in "Profile.dart" *added GestureDetector in "Feed_Dashboard.dart" for: -Messenger_Chat -Profile.dart

Deleted: GeneratedMaskWidget() GeneratedMaskWidget1() GeneratedEllipse1Widget() GeneratedHomeIndicatorWidget1() - lib/fig2flutterapp/Feed_Dashboard/generated/GeneratedHomeIndicatorWidget1.dart GeneratedHomeIndicatorWidget16() - lib/fig2flutterapp/generatedprofilemycontentwidget1/generated/GeneratedHomeIndicatorWidget16.dart

Profile pic locations(storage implementation) (lib/fig2flutterapp/Feed_Dashboard/generated/GeneratedProfileminsangchoiWidget.dart) (lib/fig2flutterapp/Profile/generated/GeneratedProfileminsangchoiWidget1.dart)

-Remove "Stack(children: [ TransformHelper.translate(..." to make pictures round -Change "blurRadius: 4.0" on any objects to "blurRadius: 30.0"

Redirect button added to home page to make navigation easier upload botton and many more clickable Feed page is now scrollable Will implement amplify storage @ "lib/fig2flutterapp/generatedprofilemycontentwidget1/ProfileUploadSound.dart"

Reference:

Select YES when "amplify pull --appId dn2h3c7zklm9x --envName staging" asks if you're going to modify the backend or else it will never connect. IAM User info - Pulling backend

Access key ID AKIAUOWCLTLC2GQFZG7U Secret access key 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

7:03pm - 12:00am Friday(5/7/2021) - 4.95H

nickowalcz commented 3 years ago

3:08 pm Encountered issue Java home supplied via 'org.gradle.java.home' is invalid. Invalid directory: /usr/local/java/jdk1.8.0_05 when running newest version off github 5/9. Removed line org.gradle.java.home=C:\Program Files\Java\jdk1.8.0_144 from gradle.properties android

3:13 When loggin into test@test.com console says AMPLIFY_SIGN_IN failed When pressing Send data in testing_page says more than one api is there. DataStoreException{message=Error during subscription., cause=ApiException{message=There is more than one API configured for this plugin with matching endpoint type., cause=null, recoverySuggestion=Please specify the name of API to invoke in the API method.}, recoverySuggestion=Evaluate details.}

Solution: Inside of amplifyconfiguration.dart we have multiple endpoints under the name "api", will need to remove unused OR specify which one to use. We have two endpoints, "mbm" and "MBM" not sure whnich is correct. The aws console unbder staging calls it "MBM" so I will try to call it with MBM. Tried removing both mbm and MBM but still doesn't work.

4:10 Will try creating a new graphQL object in testing_page to see if I can resolve this issue.

5:00 pm Could not find a solution to the multiple api problem, will try to revert to an older version and implement storage

1 hr 52 min