Multiple warning and errors using Git with Flutter in Android Studio - android

Whenever I enable Git in any Flutter Project in Android Studio it gives me the following warning when I try to commit:
9 files contain problems.
18 errors and 12 warnings found.
Would you like to review them?
Is this supposed to happen? Because it also happens on a fresh standard Flutter App without any modifications. This is what it shows when clicked to review.
C:\Users\me\AndroidStudioProjects\flutter_app\android\app\src\main\AndroidManifest.xml
Warning:(1, 2) Should set `android:versionCode` to specify the application version
Warning:(1, 2) Should set `android:versionName` to specify the application version
Warning:(5, 9) Unknown attribute android:icon
Warning:(8, 13) Unknown attribute android:launchMode
Warning:(9, 13) Unknown attribute android:theme
Warning:(10, 13) Unknown attribute android:configChanges
Warning:(11, 13) Unknown attribute android:hardwareAccelerated
Warning:(11, 13) Attribute `hardwareAccelerated` is only used in API level 11 and higher (current min is 1)
Warning:(12, 13) Unknown attribute android:windowSoftInputMode
Warning:(12, 13) Attribute `windowSoftInputMode` is only used in API level 3 and higher (current min is 1)
Error:(19, 33) Cannot resolve symbol '#style/NormalTheme'
Error:(28, 33) Cannot resolve symbol '#drawable/launch_background'
C:\Users\me\AndroidStudioProjects\flutter_app\android\app\build.gradle
Error:(1, 27) Cannot resolve symbol 'Properties'
Error:(11, 15) Cannot resolve symbol 'GradleException'
C:\Users\me\AndroidStudioProjects\flutter_app\android\settings.gradle
Error:(3, 31) Cannot resolve symbol 'File'
Error:(4, 22) Cannot resolve symbol 'Properties'
C:\Users\me\AndroidStudioProjects\flutter_app\android\app\src\main\kotlin\com\heitorfranca\flutter_app\MainActivity.kt
Error:(3, 19) Unresolved reference: embedding
Error:(5, 21) Unresolved reference: FlutterActivity
C:\Users\me\AndroidStudioProjects\flutter_app\android\build.gradle
C:\Users\me\AndroidStudioProjects\flutter_app\android\app\src\main\res\drawable\launch_background.xml
Error:(4, 29) Cannot resolve symbol '#android:color/white'
C:\Users\me\AndroidStudioProjects\flutter_app\android\app\src\main\res\drawable-v21\launch_background.xml
Error:(4, 29) Cannot resolve symbol '?android:colorBackground'
C:\Users\me\AndroidStudioProjects\flutter_app\android\app\src\main\res\values-night\styles.xml
Error:(4, 39) Cannot resolve symbol '#android:style/Theme.Black.NoTitleBar'
Error:(7, 21) Cannot resolve symbol 'android:windowBackground'
Error:(15, 39) Cannot resolve symbol '#android:style/Theme.Black.NoTitleBar'
Error:(16, 21) Cannot resolve symbol 'android:windowBackground'
C:\Users\me\AndroidStudioProjects\flutter_app\android\app\src\main\res\values\styles.xml
Error:(4, 39) Cannot resolve symbol '#android:style/Theme.Light.NoTitleBar'
Error:(7, 21) Cannot resolve symbol 'android:windowBackground'
Error:(15, 39) Cannot resolve symbol '#android:style/Theme.Light.NoTitleBar'
Error:(16, 21) Cannot resolve symbol 'android:windowBackground'```

Related

Need help to run a Github android project on an emulator on Android Studio

New to android dev.
I want to contribute to an open-source app that I use on a day to day basis but I'm struggling to run it on an emulator on Android Studio.
I've cloned it on my machine, clicked 'import project (Gradle, Eclipse,.. ADT)', selected my folder..etc..
I've created a virtual device and when I click on the triangle button, the project doesn't appear as an app on the phone?
There are some build errors which I suspect are the source of my problems but I have no idea how to resolve them.
Error:(11, 33) java: package android.support.v4.widget does not exist
Error:(28, 13) java: cannot find symbol
symbol: class SwipeRefreshLayout
location: class it.rignanese.leo.slimfacebook.MessagesActivity
_
Error:(18, 30) java: package android.support.v4.app does not exist
Error:(19, 34) java: package android.support.v4.content does not exist
Error:(96, 44) java: cannot find symbol
symbol: variable ContextCompat
location: class it.rignanese.leo.slimfacebook.PictureActivity
Error:(102, 13) java: cannot find symbol
symbol: variable ActivityCompat
location: class it.rignanese.leo.slimfacebook.PictureActivity
_
Error:(17, 33) java: package android.support.v4.widget does not exist
Error:(46, 13) java: cannot find symbol
symbol: class SwipeRefreshLayout
location: class it.rignanese.leo.slimfacebook.MainActivity
Googling on stackoverflow suggested adding a line to the dependencies section in build.gradle, but it already contains implementation 'com.android.support:support-v4:28.0.0' so the errors shouldn't be there, right?
Appreciate any advice.

Getting the following error - Error:(6, 39) error: package com.crashlytics.android.answers does not exist

Following the install instructions via fabric and doing everything via Android Studio but I'm getting the following errors
Error:(6, 39) error: package com.crashlytics.android.answers does not exist
Error:(26, 29) error: package io.fabric.sdk.android does not exist
Error:(66, 27) error: cannot find symbol class Answers
Error:(66, 5) error: cannot find symbol variable Fabric
I got it working by following the manual installation on the Fabric website.

Migrate to Google API Client

I picked LoginActivity template from Android Studio and started working on it. When I tried to run the project it gave me following errors:
Error:(10, 37) error: cannot find symbol class GooglePlayServicesClient
Error:(12, 35) error: cannot find symbol class PlusClient
Error:(18, 44) error: package GooglePlayServicesClient does not exist
Error:(19, 33) error: package GooglePlayServicesClient does not exist
Error:(33, 13) error: cannot find symbol class PlusClient
Error:(276, 12) error: cannot find symbol class PlusClient
Error:(75, 31) error: package PlusClient does not exist
Error:(157, 65) error: package PlusClient does not exist
Error:(236, 5) error: method does not override or implement a method from a supertype
Attached is the screen shot for my Android Studio version and SDK downloaded on my machine.
I know that I need to migrate to Google API Client.
So my questions are:
Is there any document to do the same which provides step by step guide ?
Why default template provided with Android Studio are not working ?

Android cannot resolve play-services symbols

When trying to compile, I get the following errors:
Error:(59, 13) error: cannot find symbol class InstanceID
Error:(59, 37) error: cannot find symbol variable InstanceID
Error:(60, 59) error: package R does not exist
Error:(61, 21) error: cannot find symbol variable GoogleCloudMessaging
Error:(88, 9) error: cannot find symbol variable LocalBroadcastManager
Error:(117, 9) error: cannot find symbol class GcmPubSub
Error:(117, 28) error: cannot find symbol variable GcmPubSub
This is in a module, which is compiled as dependent on play-services:
com.google.android.gms:play-services:7.8.0 compile
I have tried cleaning and building, invalidating the cache and restarting. What am I missing here? Why can't it find the play-services library?

Error:(3, 17) java: package org.junit does not exist- intellij

I recently started using IntelliJ to build my android application project. I imported my sherlock library as a module and added the dependency to my project. However when I try to rebuild my project to check any errors I get a lines of 10 errors like this:
Error:(3, 17) java: package org.junit does not exist
Error:(4, 24) java: package org.junit.runner does not exist
Error:(5, 23) java: package org.robolectric does not exist
Error:(7, 38) java: package org.fest.assertions.api does not exist
Error:(7, 1) java: static import only from classes and interfaces
Error:(9, 2) java: cannot find symbol
symbol: class RunWith
Error:(11, 6) java: cannot find symbol
symbol: class Test
location: class com.actionbarsherlock.internal.ResourcesCompatTest
Error:(13, 20) java: cannot find symbol
symbol: method cleanActivityName(java.lang.String,java.lang.String)
location: class com.actionbarsherlock.internal.ResourcesCompatTest
Error:(15, 20) java: cannot find symbol
symbol: method cleanActivityName(java.lang.String,java.lang.String)
location: class com.actionbarsherlock.internal.ResourcesCompatTest
Error:(17, 19) java: cannot find symbol
symbol: method cleanActivityName(java.lang.String,java.lang.String)
location: class com.actionbarsherlock.internal.ResourcesCompatTest
looks like the junit.jar is missing in your classpath. Add it and it should work.
you can check if the plugin is installed if it is. it is just matter of adding it to class path you can do it automatically by selecting the junit word and then press on the inspection left side yellow bulb choose "add junit to classpath"
Adding below line in build.gradle solved the problem...
compile 'com.android.support.test:runner:0.5'

Categories

Resources