Build an Android project with error - android

A unknown error occurs when I was building a android project with Android Studio, and the specific error as follow twisted me.
''Error:C:\Users\username.gradle\caches\3.3\scripts\ao5yh51kitdkvn790wbtokixe\init\init2ce2764386e2b8bb7806b691787e7bd8\cache.properties
(系统找不到指定的文件(can't find the file specified )。)''

1.clean project:
click on build>select clean project.
2.build project:
click on build>select build project.
3.invalid caches/Restart studio
click on file>select Invalid caches/Restart.

Related

Can't build my android project after move it to another computer

I can't build my android project in react native project, i just used this project in my old computer and it built fine, but after i clone it from my new macbook i get error.
I tried to delete the cache folder and it didn't help.
The error that i get:
FAILURE: Build failed with an exception.
What went wrong:
Could not open settings remapped class cache for espedq8f7vbnwrshulq11juyl (/Users/(UserName)/.gradle/caches/5.0/scripts-remapped/settings_3tlaqtt0fziq08p73u9gmyutn/espedq8f7vbnwrshulq11juyl/settingsa9190c3ddc71e1450eb3f3e7bc6a334f).
Could not open settings generic class cache for settings file '/Users/(UserName)/Desktop/MyApp/friendsapp/client/android/settings.gradl' (/Users/(UserName)/.gradle/caches/5.0/scripts/espedq8f7vbnwrshulq11juyl/settings/settingsa9190c3ddc71e1450eb3f3e7bc6a334f).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 57
Yes i found the answer!
I just clicked in android studio, FILE -> sync project with gradle files .
It did the magic !
Edit
Help me so many times for building:
yarn add jetifier
yarn run jetify
rebuild project in android studio
To clear Android Studio's cache and bring it out of its state of confusion, select 'File > Invalidate Caches / Restart' and then click the 'Invalidate and Restart' button.
You should invalidate caches from android studio not deleting cache folder directly.

cannot find symbol class R android studio 3.0.1

cannot find symbol class R
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
I think the project xml design contains any error. in that case R file could not be created. So please verify the xml file if no such error found then rebuild the project using Build → Clean Project / Rebuild Project
Check if there are any errors in your build.gradle (Module: app) file, and then sync it by using the refresh button from the Gradle panel.
Build > Clean Project, and then Build > Rebuild Project
I have been using MacBook Pro for my Android development, but I don't shut down but use the sleep mode normally. Because of this, my Android Studio gets out of control occasionally. Therefore, by simply restarting your entire development PC might resolve your issue.
Alternatively, you can try File > Invalidate Caches/Restart to clean up all the related caches.
Make sure that you have imported import <package_name>.R; (you can use Alt + Enter), than clean and rebuild your project (Build → Clean Project / Rebuild Project)
Note: Sometimes importing R file could not resolve the issue

When Rebuild Project at that time android studio giving error

I have just create new project and added jar files and just clicked on Rebuild Project from Build menu but it gives below error.

Importing eclipse projects to android studio

I'm trying to import an eclipse project to android studio but keep getting the error message:
Gradle 'PhotoGallery' project refresh failed:
Error:C:\Users\user\.gradle\caches\2.14.1\scripts-remapped\settings_2yhllogm103q9sdcjkhbixdfg\9ejwtyixtds2dlx9q4hqm4iap\cp_settings57408229\cache.properties (The system cannot find the file specified)
I've already tried the below, but the problem persists:
File > Invalidate Caches/Restart > Invalidate and Restart
Here is a screenshot of the issue:
Removing .gradle directory should resolve your problem because android studio will recreate gradle directory without an error.

Android Studio: Restart Error: No Android facet found for main

I have upgraded my Android studio to 2.9 and I have been getting this error when I try to run my code.
Restart Error: No Android facet found for main
On surfing the web , I found this solution
No Android facet found, issues compiling with Android Studio 0.2
But the new Android studio does not have these options in the 'Project Structure'.
Can anybody suggest any fix?
Try to open Project Structure of your project (right click on project -> Open Module Settings), and check if in Facets is added your project, if not - " + " add it. Its worked for me...
There is already an update for AS 0.2.10. Try to update AS.
And if you still get the same error:
I don't know if this will help but you also could try to import your project instead of opening it (-> your *.iml files will be generated new by as). But be careful, you have to select the right file: settings.gradle.

Categories

Resources