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

Please update the application code #33

Closed
omar-danasoury opened this issue Aug 1, 2022 · 2 comments
Closed

Please update the application code #33

omar-danasoury opened this issue Aug 1, 2022 · 2 comments

Comments

@omar-danasoury
Copy link

C:\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in quizzler-flutter... 1,426ms
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
Process finished with exit code 0

@FreakyAli
Copy link

FreakyAli commented Aug 7, 2022

I'm not 100% certain why they have not updated their repos but in any case, an easy way to fix the issue that you are facing is to replace your MainActivity with below:

package co.appbrewery.quizzler;
import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {
}

And your Manifest with below:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="co.appbrewery.quizzler">

    <!-- The INTERNET permission is required for development. Specifically,
         flutter needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>

    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <application
        android:name="${applicationName}"
        android:label="quizzler"
        android:icon="@mipmap/ic_launcher">
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- This keeps the window background of the activity showing
                 until Flutter renders its first frame. It can be removed if
                 there is no splash screen (such as the default splash screen
                 defined in @style/LaunchTheme). -->
            <meta-data
                android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
                android:value="true" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>
</manifest>

Hope this helps you and others :)

More information on migration here : https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

@omar-danasoury
Copy link
Author

Thanks brother @FreakyAli, it worked with me!

I editedthe code in the Main Activity of Clima project and just changed the name from co.appbrewery.quizzler to co.appbrewery.clima . Besides, in the AndroidManifests.xml, package="co.appbrewery.quizzler" was changed to package="co.appbrewery.clima".

So you can quizzler to the project name you are working on.

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

No branches or pull requests

2 participants