Closed 0xcyb3rw0lf closed 2 years ago
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
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
.
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