Flutter Throw Errors When opening AndroidManifest.xml - flutter

../android/app/source/main/AndroidManifest.xml
Unresolved class '{applicationName}'
Cannot resolve symbol '#mipmap/ic_launcher'
MainActivity must extend android.app.Activity
Cannot resolve symbol '#style/LaunchTheme'
Cannot resolve symbol '#style/NormalTheme'
I created new project then I checked AndroidManifest.xml file and it throw couple of error.
My flutter looks okay on flutter doctor.
Any ideas on how to resolve?
Thanks!

You don't worry about these errors, just run your app, It should work fine!!!

Many one got this error but it is just an error of IDEs.so don't worry and run your app you will not get any error.

Related

Why is an error coming in my untouched build.gradle file?

I was receiving this error in my build.gradle file (under android > app [This is for flutter in Android Studio]). The error is on 'Properties' and 'Gradle Exception'.
How do I fix this error, and is it necessary to fix it?
I haven't tried to change anything, and it was like this by default when I first opened the file.
It's not an error.
If you want to remove the warning in GradleExeption, just remove it and replace it with RuntimeException.

How i can fix ':app:checkDebugDuplicateClasses' Error

I ran into a problem, I need Jitsi Meet and DartSIPUa in the project, but when I put them together it gives a duplicate error, I attached the log below. Can you also explain to me why my Flutter project that has JitsiMeet uses react-native-webrtc?
I tried for a long time to find what the reason might be, as long as JitsiMeet works separately from DartSIPUa, everything is fine, but I need them in one app, how can I do this?
Thank you all in advance for your help.
Log: https://pastebin.com/2RT30qEs
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class org.webrtc.AndroidVideoDecoder found in modules classes.jar (org.webrtc:google-webrtc:1.0.28262) and libwebrtc.jar (com.facebook.react:react-native-webrtc:1.75.3-jitsi-4429568)
Duplicate class org.webrtc.AndroidVideoDecoder$1 found in modules classes.jar (org.webrtc:google-webrtc:1.0.28262) and libwebrtc.jar (com.facebook.react:react-native-webrtc:1.75.3-jitsi-4429568)
found a github issue
TLDR
I solved the two above problems as following:
First problem (:app:checkDebugDuplicateClasses)
solution was: Through android studio
File > Invalidate Caches/Restart...
Second problem (:app:mergeDebugJavaResource)
The solution was:
Due to the generated build file path exceeds the windows max path length of 255 characters.
Only trying to use short names to make sure the project path is not too long, solved the problem.
This is the path in my machine:
C:\Users\Hakim.gradle\caches\modules-2\files-2.1\io.flutter\x86_64_debug\1.0.0-a67792536ca236a971d0efbcfd7af4efb8f6c119\1ae520cbbf7e14af867232784194366b3d1c3f34\x86_64_debug-1.0.0-a67792536ca236a971d0efbcfd7af4efb8f6c119.jar
You can find the path in your machine and change the long file name to short one.
else try downgrading your flutter version

Why the app produced by flutter build web sometimes doesn't work?

I have 2 issues that only appear when executing flutter build web.
Sometimes flutter build web fails complaining (wrongly) about types that were not compatible (see below).
Sometimes the build process finishes but then the web app doesn't work: doesn't display anything and there are no messages in the console.
The error I mention is something like this:
% flutter build web
Target dart2js failed: Exception: lib/main.dart:24:31:
Error: A value of type 'ApiUsersRepository' can't be assigned to a variable of type 'UsersRepository'.
- 'ApiUsersRepository' is from 'package:my_app/api_users_repo.dart' ('lib/api_users_repo.dart').
- 'UsersRepository' is from 'lib/users_repo.dart'.
final UsersRepository usersRepository = ApiUsersRepository();
^
Error: Compilation failed.
The app is working in iOS and web when developing.
The solution
I changed all imports of my files like:
import 'package:my_app/users_repo.dart';
To:
import 'users_repo.dart';
More Details
Investigating the error about types, I found this issue, where the important part is this comment: after changing every import to relative format it resolves my problem.
So I did that, and it solved the 2 issues, the compilation error, and the runtime error.
for me I had to remove a package that was corrupted. c:\src\flutter.pub-cache\hosted\pub.dartlang.org\localstorage-4.0.0+1 Apparently, a file had become corrupted by me invertly. I removed the package and did a flutter pub get then recompiled and it worked.

I have an error when executing ionic serve

When I execute ionic serve, it shows the following errors:
Refused to load the image 'http://localhost:8100/favicon.ico' because
it violates the following Content Security Policy directive:
"default-src 'none'". Note that 'img-src' was not explicitly set, so
'default-src' is used as a fallback.
Failed to load resource: the server responded with a
status of 404 (Not Found)
How can I solve this?
I had the same error message.
Looking through the logs printed when doing
ionic serve
showed me a bunch of errors, all similar to this
[ng] ERROR in ./src/global.scss (./node_modules/#angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/global.scss)
[ng] Module build failed (from ./node_modules/sass-loader/lib/loader.js):
[ng] Error: Cannot find module 'node-sass'
[ng] Require stack:
This lead me to get the application up and running again by
npm install node-sass --save
The compilation process is sometimes spitting out rather confusing error messages from time to time, but with a little digging one can start guessing where to start poking
I had the same issue. I was able to solve it. I fixed the routing file, I had a route that couldn't load because another route was higher order.
Ionic include default favicon icon into index.html file.
<link rel="icon" type="image/png" href="assets/icon/favicon.png" />
You can put your favicon icon into "assets/icon" and replace href above.
I had this error and it was because I had included an import I wasn't actually using. In my example, I had accidently imported Console when using console.log.
I was getting error TS2307: Cannot find module 'console'. in the VS Code terminal, but my error in Chrome was "Refused to load the image 'http://localhost:8100/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
Failed to load resource: the server responded with a status of 404 (Not Found)"
So be aware that this error is not necessarily to do with the favicon.
I had same issue but solved using below solution.
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico" />
I used .ico file instead of .png file and thats works for me. try once.
I get same error multiple times,this error throw when u missed any small issue like wrong image path or forget to write import statement of any module/service/component.these error will shown in terminal when u running your project.After fixing these run your project
I had the exact same problem.
I advise you to take a look at your Terminal in VSCode (or the standard terminal if you launched it by there) and look for an ERROR message.
Most likely the problem isn't the favicon.ico blabla stuff but another element of your app, something in a .ts doc for example. Via Terminal you can seek for it in a better way than Chrome, that shows you this unrelated message.
I too faced same error .In my case i have done mistake in importing file
import { IUser } from 'src/app/shared/interfaces/IUser
Changed path like below is fixed error.
import { IUser } from './shared/interfaces/IUser
Cross check your import file. it might helps
I got the same error when I downloaded a new branch of the project, I just run npm install of the lastest components
I solved by created copy favicon.png from assets/icon/favicon.png to root project folder and rename it to favicon.ico , and also put it on assets/icon/favicon.ico
and also check this answer .
https://stackoverflow.com/a/63749758/8370334
Same issue here with ionic v5 and angular v10.
You may have this error when you create some error in the variables.scss file.
I was using adding a list of global variable that will be used across the app but I forgot to add a ,.
It didn't create an error while compiling...
The code was :
$color-settings: (
'primary': (
'base': #297bfd,
) // <-- Comma is missing here
'secondary': (
'base': #297bfd,
)
}
It will display the same error, I think, it breaks somehow the way ionic compile the scss.
I had the same issue after an upgrade. I solved the problem doing:
npm rebuild node-sass
Try to change the browser, I fixed this clicking on the url resource which opened firefox and then I've been able to test the app normally on Firefox

How To Fix This Error [Error: Failed to find '#ionic/angular/css/display.css']

When i run the operation ionic serve it fails to compile and gives an error code that says:
ERROR in ./src/global.scss (./node_modules/#angular-devkit/build-
angular/src/angular-cli-files/plugins/raw-css-
loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/
sass-loader/lib/loader.js??ref--14-3!./src/global.scss)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Failed to find '#ionic/angular/css/display.css'
in [
C:project/src
]
at resolveModule.catch.catch (project\node_modules\postcss-
import\lib\resolve-id.js:35:13)
This is a piece of code i tried to integrate into my own project which opens the camera to take a picture and you can either upload the picture or delete it. I tried searching for "#ionic/angular/css/display.css" on the internet but couldn't find a solution. I started ionic just recently so i don't understand much about it.
If anyone wants to see the code It is here The original i took it from had the code at home.page.ts but i needed it at tab1.page.ts so the error may be born from this. Also global.scss
The method i used to solve the problem is importing "#ionic/angular/css/display.css". I did it manually taking it from a project where it exists and copying it to the Project which gives the error.