GithubHelp home page GithubHelp logo

londonappbrewery / xylophone-flutter Goto Github PK

View Code? Open in Web Editor NEW
116.0 5.0 885.0 3.06 MB

Starter code for the Xylophone project in the Complete Flutter Bootcamp

Home Page: https://www.appbrewery.co

Java 6.39% Objective-C 33.20% Dart 13.67% Shell 34.92% C 4.59% Swift 7.23%

xylophone-flutter's Introduction

App Brewery Banner

Xylophone 🎹

Our Goal

In this tutorial we will be diving into more Dart programming concepts and learning how to use open source Flutter packages. By the end of this module, you should be comfortable using Flutter packages and building repeated widgets.

What you will create

We’re going to make a music app that plays Xylophone sounds. For every Beethoven out there, this will let you unleash your musical talent where ever you are.

Finished App

What you will learn

  • How to incorporate open source libraries of code into your project using Flutter Packages.
  • How to play sound on both iOS and Android.
  • How to generate repeated user interface Widgets.
  • How to use Dart functions that can take input arguments as well as return an output.
  • Dart arrow syntax for writing one line functions.

This is a companion project to The App Brewery's Complete Flutter Development Bootcamp, check out the full course at www.appbrewery.co

End Banner

xylophone-flutter's People

Contributors

angelabauer avatar anu-rock avatar themuellenator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xylophone-flutter's Issues

Audio tag error

I'm using the new version of flutter 3.0.5 and here is the error.
image
I've tried using different solutions but the results were not solving the issue.

Incompatible classes were found in dependencies

to solve this issue
go to your project file, then
Android > build.gradle (not the one in app>src)

change Kotlin version to the latest.
by the time I am writing this, It is
ext.kotlin_version = '1.5.21'
after updating the version, rebuild the app, Your problem might be solved.

Flutter stub project is deprecated for new M1 Macs

The previous project has many deprecated setup, the Audioplayers package requires v2 of the Android embedding. After which, I've encountered multiple issues with the pod setup pointing to the incorrect IPHONEOS_DEPLOYMENT_TARGET = 8.0 when it needs to be at 9.0.

Please do a new flutter create and just port over the assets for the audio files and icon resources. Others might be encountering this issue soon.

FlatButton to TextButton

Console is saying FlatButton is outdated and suggests to use TextButton.
but TextButton is not accepting color. How do I do that?

Unable to generate apk

While generating apk :-

  • What went wrong:
    Execution failed for task ':audioplayers:verifyReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
C:\Users\kumar.gradle\caches\transforms-2\files-2.1\e9dab9c67c1ee3668e0bbf86c6d8cbd8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.

 C:\Users\kumar\.gradle\caches\transforms-2\files-2.1\e9dab9c67c1ee3668e0bbf86c6d8cbd8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'audioplayers'.

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 19s

The plugin audioplayers could not be built due to the issue above.

i need some help i can't run xylophone-flutter

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugResources'.

Android resource linking failed
Output: C:\xylophone-flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:186: error: resource android:attr/fontVariationSettings not found.
C:\xylophone-flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:187: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: C:\Users\user.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\ed5d63241c32b03b627a8ec4203b323c\aapt2-3.2.1-4818971-windows\aapt2.exe link -I
C:\Users\user\AppData\Local\Android\sdk\platforms\android-27\android.jar
--manifest
C:\xylophone-flutter\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml
-o
C:\xylophone-flutter\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_
-R
@C:\xylophone-flutter\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt
--auto-add-overlay
--java
C:\xylophone-flutter\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r
--custom-package
co.appbrewery.xylophone
-0
apk
--output-text-symbols
C:\xylophone-flutter\build\app\intermediates\symbols\debug\R.txt
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
Output: C:\Users\user.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\81bcf9a7fa6cfeeb7c44abcfdc197db5\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.

C:\Users\user.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\81bcf9a7fa6cfeeb7c44abcfdc197db5\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.

error: failed linking references.
Command: C:\Users\user.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\ed5d63241c32b03b627a8ec4203b323c\aapt2-3.2.1-4818971-windows\aapt2.exe link -I
C:\Users\user\AppData\Local\Android\sdk\platforms\android-27\android.jar
--manifest
C:\xylophone-flutter\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml
-o
C:\xylophone-flutter\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_
-R
@C:\xylophone-flutter\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt
--auto-add-overlay
--java
C:\xylophone-flutter\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r
--custom-package
co.appbrewery.xylophone
-0
apk
--output-text-symbols
C:\xylophone-flutter\build\app\intermediates\symbols\debug\R.txt
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s
Finished with error: Gradle task assembleDebug failed with exit code 1

Application won't work with the package AudioPlayers on Android VM

For some reason, the application throws an error,
audioplayersPlugin(28127): java.lang.RuntimeException: Unable to access resource
However, even after adding the permission in the manifest won't work and reproduces the error.
• You can add a note in the course to either use a different package available. Here is a really nice list
https://medium.com/flutter-community/how-to-add-music-audio-to-your-flutter-app-dcb6162c32d7
• I used Assetsaudioplayer and it worked absolutely fine.

                _assetsAudioPlayer = AssetsAudioPlayer();
                _assetsAudioPlayer.open(AssetsAudio(
                  asset: "note1.wav",
                  folder: "assets/",
                ));
                _assetsAudioPlayer.play();
              },```

The xylophone is missing one tone

The whole octave has one tone missing. When showing the application to a friend, she pointed out that there are only 7 keys on the xylophone. It would make sense to add the last one as a challenge or something but definitely to attach the tone with the stub project.

audios not recognised

Screenshot 2023-12-30 223104
the notes that I have downloaded from assets folder from this repository are not recognized when using in Android Studio. Please help me to solve this issue

Migration issue

This project file is outdated, wasted my 2 hours. so embarrassing.

iOS app does not run with latest Xcode and Mac version

Build failed with multiple link error like below,
ld: warning: Could not find or use auto-linked library 'swiftCoreAudio'

I resolved the issue by following the suggestion in https://stackoverflow.com/questions/52536380/why-linker-link-static-libraries-with-errors-ios

I opened Runner.xcodeproj in Xcode and it asked to update the Deployment models, which I clicked "Continue" and then created an empty File.Swift in Runner directory in Xcode which created a Bridging Header.

Please update the base project so that it is easy for learners to start using this project.

Flutter Migrate

How could i migrating this project to newer version of flutter .

FlatButton() is deprecated

hi,
the FlatButton widget is deprecated the alternatives are TextButton or ElevatedButton but neither seem to have a color property like FlatButton. am i right? which button should i use in this project and how do i define its color?

ocoaPods not installed. Skipping pod install.

After importing the audio package, setting up statelessWidget, I switch off the app and started again. On running the app again, i got the error below

class XylophoneApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: SafeArea( child: FlatButton( onPressed: () { final player = AudioCache(); player.play('note1.wav'); }, child: Text('Click Me'), ), ), ), ); } }

-----------------------------------Error----------------------------------------
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods

CocoaPods not installed or not in valid state.
Error launching application on iPhone 11 Pro.

gradle task assembledebug failed with exit code 1

Your Flutter application is created using an older version of the Android embedding. It's being deprecated in favor of Android embedding v2. Follow the steps on https://flutter.dev/go/android-project-migration to migrate your project.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':path_provider:parseDebugLibraryResources'.

Could not resolve all files for configuration ':path_provider:androidApis'.
Failed to transform file 'android.jar' to match attributes {artifactType=android-platform-attr, org.gradle.usage=java-runtime-jars}
> Execution failed for PlatformAttrTransform: C:\Users\hp\AppData\Local\Android\Sdk\platforms\android-28\android.jar.
> C:\Users\hp\AppData\Local\Android\Sdk\platforms\android-28\android.jar (The system cannot find the file specified)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 18s
Exception: Gradle task assembleDebug failed with exit code 1

please reply how to solve this problem............

wav files

Hi Angela,
I have did the clone for the xlophone as stated in your video training but i am seeing ? near the wv files in the asset folder and the the wav files and when pressing button, it is not playing the sound. the files are fine. I tried to play them from the folder and it works. I tried removeing them and reinserting them in the asset folder, same error. what do you suggest?

difficulty in playing multiple sounds

The UI is working fine but an error comes whenever I press the button.

E/flutter (15820): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Unable to load asset: assets/1.wav
Screenshot (18)

Here's the code

Actually I copied and pasted the code from one of the projects to see whether some problem is there in my code.
Screenshot (19)

Here's the pubspec
Screenshot (20)

Please help, I am stuck here and I don't want to go on further before busting this error.
Please help!!!

Readme: Minor typo

The second sentence of Our Goal section goes like:

By the end of this module, you should be conformable using Flutter packages and building repeated widgets.

The word conformable should be comfortable to make better sense of the sentence.

the sounds stops playing after a few seconds

after I play with the buttons and quickly press them a few times. all the buttons completely stop working. My code was the same as ms angela. I had to earlier move my project into new android embedding.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.