0

I'm currently struggling to build my Flutter project for Android, I've built a number of versions of it but since trying to use firebase core it's caused this error. I don't even need firebase core anymore but removing it from the pubspec file doesn't completely remove it so I'm stuck with these two errors

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':compileReleaseAidl'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/billy/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.5.3/android/local.properties'.

* 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 2s


The plugin firebase_core could not be built due to the issue above.
FAILURE: Build completed with 2 failures.                               
                                                                        
1: Task failed with an exception.                                       
-----------                                                             
* What went wrong:                                                      
Execution failed for task ':app:processReleaseResources'.               
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed                                    
     /Users/billy/Desktop/healthy-flutter-app/android/app/src/main/AndroidManifest.xml:15:9-21:20: AAPT: error: attribute 'android:name' in <receiver> tag must be a valid Java class name.
                                                                        
     /Users/billy/Desktop/healthy-flutter-app/android/app/src/main/AndroidManifest.xml:22:9-23:82: AAPT: error: attribute 'android:name' in <receiver> tag must be a valid Java class name.
                                                                        
                                                                        
* 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.
==============================================================================
                                                                        
2: Task failed with an exception.                                       
-----------                                                             
* What went wrong:                                                      
Execution failed for task ':app:bundleReleaseResources'.                
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed                                    
     /Users/billy/Desktop/healthy-flutter-app/build/app/intermediates/bundle_manifest/release/processReleaseManifest/bundle-manifest/AndroidManifest.xml:32: AAPT: error: attribute 'android:name' in <receiver> tag must be a valid Java class name.
                                                                        
     /Users/billy/Desktop/healthy-flutter-app/build/app/intermediates/bundle_manifest/release/processReleaseManifest/bundle-manifest/AndroidManifest.xml:38: AAPT: error: attribute 'android:name' in <receiver> tag must be a valid Java class name.
                                                                        
                                                                        
* 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                              
                      

Just in case anyone needs to see my AndroidManifest It's below

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.healthyapp">
    <!-- 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. -->
        <uses-permission android:name="android.permission.VIBRATE" />
        <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
        <uses-permission android:name="android.permission.INTERNET" />
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="Healthy"
        android:icon="@mipmap/ic_launcher">
        <receiver android:name="
        com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
          <intent-filter>
          <action android:name="android.intent.action.BOOT_COMPLETED"/>
          <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
          </intent-filter>
        </receiver>
        <receiver android:name="
        com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />  
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter>
              <action android:name="FLUTTER_NOTIFICATION_CLICK" />
              <category android:name="android.intent.category.DEFAULT" />
            </intent-filter> 
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.24.0-8.0.pre.319, on macOS 11.1 20C69 darwin-arm, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.53.2)
[✓] Connected device (1 available)

• No issues found!
Billy Noyes
  • 103
  • 2
  • 9

0 Answers0