Android Studio incorrectly reports lack of manifest permission - android

Android Studio 4.2.1
Gradle 6.7.1
Gradle Plugin 4.2.1
From time to time (and unclear what causes this, although I think it might be related to interrupting a full rebuild), Android Studio gets "confused" about what permissions are set in AndroidManifest.xml, and shows errors within source code. Usually this happens on the VIBRATE permission I use, but I have recently started seeing it on NETWORK related permissions, like this:
Even though my manifest has it set:
When this happens, no manner of rebuilds, invalidate cache/restart seems to help, until at some point it generally just "goes away". A build and project run will work, I just continue to see errors in various files which reference permissions that AS thinks I have not granted.
I assume this is some gradle problem? What can I do about it?

Related

Do not build Android project automatically on opening

I have been using Android studio for a long time, yet never understood what are the processes that Android studio runs at when we load a new project via File>New or File>Open. We just load the project and have to wait for so many minutes before the android studio completes those processes (I know that we can still click on file names and editor would open them, but i have observed the android studio will still lag until all those processes are completed)
However I don't know how, recently My Android studio started behaving differently. I don't know what i did, But every time i created a new project, or loaded a previous one, it would show a message like this:
This was very good for me, because even when i don't click the try again
button, I am still able to access all files and without any lag, thereby removing a need for external file editor. I feel this was some bug in gradle or cache handling that got fixed when i uninstalled AS and updated to AS 3.5 .
So is there a way to manually run all those build and indexing processes, instead of Android Studio just running them automatically?
UPDATE:
I think i was not clear before. I want that error to occur . Meaning I want to have a control over when the building process starts. Also, I am NOT having any error as of now, all my projects are working fine.
Look for highlighted warnings in you Gradle file, you may need to update some things and then sync again.
You could also try to clean and rebuild your project.
You can also File->Invalidate Caches / Restart if none of the above work.
If none of the above work, please provide more details on what warnings/errors you get.
When version conflict in gradle file, it cant be able to build and sync the project.There may be show "Unsupported Modules Detected: Compilation is not supported for following modules”. Fix them too

Android manifest activity disappeared

I have a problem when I try to build or run my Android app.
I restored my project (after some others bugs), I removed and I added again Android platform.
Everything in Android manifest seems correct: activity, permission, service.
If I run “ionic cordova run android --device” the android manifest is recreated but It’s not the same !!!
How is it possible ? Can I run/build without recreate android manifest ?
That’s is very important because otherwise I got activity not found error in some situations.
It was a custom edit-config in config.xml that was breaking my rebuild. I removed it and it seems to work well now.

Gradle not syncing at all?

I just updated AS since a while and Gradle seems to be broken.
Create a empty LibGDX gradle project with the latest LibGDX setup.
Add dependency to core in build.gradle. Nothing happens, used to get a popup with something like "Sync now" I believe.
Clean project does not seem to do anything. Bottom left says nothing about a recent (un)successful clean.
Rebuild project does not seem to do anything.
Adding jibberish sdfdfsdfsffsd;;;sfes;efs to the gradle file does not change anything. My program still runs, no errors in build.gradle and clean still does not do anything.
Never really had problems with AS and Gradle, it just worked out of the box. Now it seems to be broken but I cannot seem to find anything on the subject. A reinstall might fix things but fixing it without a reinstall would be nice.
Edit
I somehow managed to trigger the gradle sync by closing/opening AS and opening my project again. But now it won't even recognize the LibGDX framework anymore.
Edit
Somehow it seems related with unchecking Android in the LibGDX setup tool. This was no problem in the past for me but once I tried to create a project with the android module enabled it seems to work. My guess is the LibGDX tool messes up somewhere with generating the gradle files but it's still very strange behavior. Perhaps someone could attempt to start a project without the android module and tell me if he is running into the same issues. Note that at first import the default LibGDX program runs fine but importing dependencies through Gradle and restarting AS is causing issues here.

Android Studio: appcompat installation fails

I've a strange problem. I just installed the most recent version of android studio and created a plain vanilla blank activity application. After that, when the IDE opens it tries to install com.android.support:appcompat-v7:14+. However, then I get the error message:
Failed to resolve: com.android.support:appcompat-v7:14+
Install repository and sync project
So, I click on Install repository and sync project however, then I get the following error message:
Loading SDK information...
Ignoring unknown package filter 'extra-android-m2repository'Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
And underneth it red it is stated:
Install Failed. Please check your network connection and try again. You may continue with creating you project, but it will not compile correctly without the missing components.
So, my internet connection is perfectly fine, no traffic gets block by an firewall or something.
What is wrong here? Are there alternatives for installing com.android.support:appcompat-v7:14+?
I think you have an incorrect version on your compile tag (23.0.1, instead of 14+):
Try:
compile 'com.android.support:appcompat-v7:23.0.1'
instead of:
com.android.support:appcompat-v7:14+
and you may need to update your compile and tools versions as well (which is required to use the new versions of AppCompat, etc):
compileSdkVersion 23
buildToolsVersion "23.0.1"
Go into your SDK Manager, and make sure you have updated the Support Libs (you will see I have those checked in the image)
You will need to make sure these are updated.
FYI, this is the new SDK Download in Android Studio - your UI may look slightly different, but you still need to update those components
I increased tmpfs size and the problem was gone.
I also had this problem with AndroidStudio 2.1.1 running on Fedora laptop. At the first glance this solutions sounds ridiculous since the error message says we should check the network connection. For some time I left off the problem because I did not find the solution. At some point later Gradle also started to complain that he did not have enough space in the disk. When I checked my file systems with df, only tmpfs looked full. Thus I extended it. Then the component installation problem was also solved.
You might not solve your problem by increasing tmpfs, but the point is that DON'T be mislead by the error message. We've got to check also somewhere else.

Error code 1. Cordova Visual 2015 Studio

I was usually running my application, however was not getting access in the emulator due to the network proxy, I made some changes in the emulator network to gain access, however now when I run the application I'm having the following error:
I have tried clearing the cordova cache several times however not decided.
Also I tried to delete the specific way, however also not decided, what should I do with this error.
Sorry to hear about your trouble. There are a couple of things that could be causing this. One possibility is that you need the 64-bit JDK because you are running into issues. However, it looks like you're more likely missing a dependency.
Can you try running the dependency checker and verify that you're not missing anything? Go to tools -> options -> Tools for Apache Cordova -> Run Dependency Checker and install anything that it says you're missing.

Categories

Resources