Coder Social home page Coder Social logo

Comments (11)

willlarche avatar willlarche commented on May 12, 2024

Hi, Krisna! That sounds like an error relating to Dart 2. You seem to still have an older version of Flutter and Dart that doesn't accept the new Dart 2 syntax. In Dart 2, you don't have to include new in all your calls to the constructor.

Try a couple things.

First, try going to IntelliJ IDEA menu and clicking on Check for Updates. There is probably an update for IntelliJ and updates for the Dart and Flutter plugins.

If this is all up to date and you still have a problem, go to IntelliJ IDEA -> Preferences -> Languages & Frameworks -> Flutter and make sure "Run applications in Dart 2.0 mode" is set to "Enable Dart 2"

Write back if you still have problems.

from material-components-flutter-codelabs.

krisnaw avatar krisnaw commented on May 12, 2024

Hi @willlarche
Thanks for the response.

I've made it work on both iOS and Android simulator after updating the IntelliJ IDEA & enabling Dart 2.
But when I tried to run on a real device (Android 8.0.0 | using USB-C to USB-C 3.1), it keeps on the
Installing build/app/outputs/apk/app.apk process.

from material-components-flutter-codelabs.

Sfshaza avatar Sfshaza commented on May 12, 2024

@krisnaw, did you set your Android device to developer mode?

from material-components-flutter-codelabs.

krisnaw avatar krisnaw commented on May 12, 2024

Hi @Sfshaza
Yes, I've set my device to developer mode.

  1. I tried making a simple app using flutter create test-app first and run it on my device. It works fine.
  2. After that, I'm cloning the material design app and following the steps. Then it stuck on the Installing build/app/outputs/apk/app.apk process.

from material-components-flutter-codelabs.

Sfshaza avatar Sfshaza commented on May 12, 2024

In the first report, you say you're seeing error messages about "new"? Is that what's happening when you use the MDC code on your device? If that's the case, it sounds like a versioning issue.

from material-components-flutter-codelabs.

krisnaw avatar krisnaw commented on May 12, 2024

Hi @Sfshaza

The first issue is caused by outdated Flutter & Dart on my IntelliJ. And already fixed by following @willlarche suggestion. So it works fine when I run it on both iOS and Android simulltor, but stuck on Installing build/app/outputs/apk/app.apk when I tried to run on real device.

from material-components-flutter-codelabs.

krisnaw avatar krisnaw commented on May 12, 2024

Updates
This is the error I getting after enable verbose mode when running the app on device

           
           Error type 3
           Error: Activity class {com.example.mdc100series/com.example.mdc100series.MainActivity} does not exist.
[        ] Waiting for observatory port to be available...

from material-components-flutter-codelabs.

willlarche avatar willlarche commented on May 12, 2024

I spoke with someone who knew about this stuff.

Docs on the Android manifest are at:
https://developer.android.com/guide/topics/manifest/manifest-intro

The error mentions the component name
"com.example.mdc100series/com.example.mdc100series.MainActivity". The
part of the component name before the slash is the application package
name, and after the slash is the activity class. Some checks to do:

  • Does the manifest specify the package name "com.example.mdc100series"?
  • Does the package include an activity named ".MainActivity"?
  • Does the Java code in the APK include an activity class named
    "com.example.mdc100series.MainActivity"?

from material-components-flutter-codelabs.

krisnaw avatar krisnaw commented on May 12, 2024

Hi @willlarche
Thanks for the responses

  1. Does the manifest specify the package name? Yes
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.mdc100series">

  2. Does the package include an activity name ".MainActivity"? Yes, there is a file named MainActivity

  3. How do I check if the APK ?

from material-components-flutter-codelabs.

willlarche avatar willlarche commented on May 12, 2024

Hmm. I'm not expert enough in Android to answer that. I'd ask for more help in the Flutter chat room: https://gitter.im/flutter/flutter

from material-components-flutter-codelabs.

willlarche avatar willlarche commented on May 12, 2024

Going to close since it's an issue on using IDE. If you learn anything that's really useful for us to add to the setup instructions, report back.

from material-components-flutter-codelabs.

Related Issues (20)

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.