I have an Android Studio project that I imported in SVN. I didn't add some files like the build folder, local.properties, the .idea folder and .gradle folder, as suggested here. Then I checked out the project in another directory on my machine and imported it into Android Studio.
After the import, I tried to clean the project, but the option wasn't present in the GUI. I found it weird so I checked the list tasks with ./gradlew tasks and the ouput was indeed quite short (help tasks not shown):
Build Setup tasks
init - Initializes a new Gradle build. [incubating]
wrapper - Generates Gradle wrapper files. [incubating]
In the original project, here are a lot of other tasks (Android, build, install, verficitation and other tasks). Has anyone a clue on what is going on here ? The weird thing is that I just did the same procedure with another project and didn't get any problem.
Thank you
In my case there wasn't anything wrong with my settings.gradle file. If someone is still searching the solution, try to do these steps from my answer on similar question
Okay I figured out what the problem was.
After the import, the settings.gradle couldn't resolve some of the dependencies. I had some lines like
project(':apps').projectDir = new File(settingsDir, '../Libraries/apps')
Which I had to modify to
project(':apps').projectDir = new File(/home/path/to/workspace/Libraries/apps')
I will just leave to here if someone needs it.
Related
There is plenty of "chatter", but I did not find an answer for my project.
While performing the Gradle Sync in my project with Crashlytics, Gradle fails to sync. I have other projects that are just fine and when I 'diff' the build.gradle files and other Android Studio settings, they have the same values and settings related to Crashlytics.
A problem occurred configuring project ':app'.
> org.gradle.api.GradleException: Crashlytics could not determine stripped/unstripped native library directories for project ':app', variant Debug. These are required for generating symbol files when NDK build tasks cannot be automatically inferred. Please specify strippedNativeLibsDir and unstrippedNativeLibsDir in the firebaseCrashlytics extension.
I am not looking for someone to triage my configuration, instead I want to know where in my project files can I find the "firebaseCrashlytics extension" and its configuration and where are the stripped and unstripped files so I can supply a path? If you know the answer from documentation, please share the link.
Make sure your android/app/build.gradle has the following:
release {
// ...
firebaseCrashlytics {
nativeSymbolUploadEnabled true
strippedNativeLibsDir 'build/intermediates/stripped_native_libs/release/out/lib'
unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
}
// ...
}
See https://github.com/invertase/react-native-firebase/issues/4253#issuecomment-797187492
In my case, I had a few projects cloned locally of the same repo. One of them was for a too old branch. Like 3-4 years back. For it, I have given a path to another NDK in the local.properties file.
ndk.dir=C\:\\NDK\\android-ndk-r13b\\android-ndk-r13b
It was causing my problem with the recent branches. After deleting it - it worked. So even if it is not the exact same case for you - it is most likely that you are building with the wrong SDК. Try updating in the SDK manager or maybe actually try explicitly saying what you need as I was doing above.
In my project-level build.gradle, Android Studio recommends updating the the firebase-crashlytics-gradle from 2.1.1 to 2.4.1. When I take the upgrade recommendation, the gradle sync fails, therefore I am unable to build my project. The error was obscured as I inherited this old project that is several versions behind and I updated all (most) of the frameworks and could not pin-point to this single dependency. I started over and upgraded selectively piecemeal until this was the lone down-level dependency.
I will try again at a later time when there is yet another update
to include.
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'org.jacoco:org.jacoco.core:0.8.0'
// Unable to build with v2.4.1 of firebase-crashlytics-gradle on this version of build (2021/02/02)
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
}
Xamarin Android project is built well locally on Windows/Mac, but fails on AppCenter/Azure pipelines with weird errors like:
Error APT0000: resource style/Theme.AppCompat.Light.DarkActionBar (aka com.companyname.build_testing_andx:style/Theme.AppCompat.Light.DarkActionBar) not found.
Error APT0000: style attribute 'attr/colorPrimary (aka com.companyname.build_testing_andx:attr/colorPrimary)' not found.
This mostly looks like lack of necessary libraries to restore by Nuget.
As it appeared after long investigation, and no matter how the solution sounds dumb, but the solution might save some time for someone.
The reason such projects can't be build on AppCenter/Azure (and that might be related to any other Visual Studio project) is that Nuget packages not being restored successfully.
The problem is that when using Nuget task, it doesn't indicate any issues. It just finishes well.
But it happens because the sources don't include *.sln file, thus Nuget doesn't have a point where to start from for the packages restoring.
Sometimes it might happen when this file is just not included into sources pushed to repository by number of reasons.
*(It's weird because the builds often project-oriented, and when working on Visual Studio it automatically creates the .sln file (not necessary around the project folder), so sometimes it might just be not included and you have no idea what's causing the errors above).
So, just to be sure you've got your *.sln file added to your repository and it's available for the AppCenter/Azure build.
Beta 3 doesn't allow to rename resource files such as layout files. It does show the renaming dialog, but when trying to apply changes it reads the following error message:
Refactoring cannot be performed
File .../myapplication/R.java is read-only
Also I have Beta 2 version in a neighbor directory and renaming works perfect. Any ideas how to fix that?
UPD:
I reported the bug (#65079508), and now it is marked as a duplicate of 65032914 https://issuetracker.google.com/issues/65032914
So, the issue is even wider and if I understand it well the bug will be fixed in some coming version of the Studio.
UPD#2:
Beta 4 is released. The bug is still not fixed.
UPD#3
Fixed in Beta 5.
meh, just get rid of the generated files && then refactor.
Gradle --> app --> build --> clean.
I am experiencing the same issue on Android Studio 3.0 Beta 3. I fixed the problem by:
Exiting Android Studio
Navigating to the folder that the layout file is saved in (either CLI or GUI)
Rename the file to whatever you want the refactored file to be called.
Reopen Android Studio.
Obviously this forces you to have to manually refactor the references to the old file, but I tried about a dozen different things (changing R.java permissions, Gradle clean, invalidate cache, etc.) and none of them worked.
Anyone else who has this issue should submit this bug in Android Studio by using Help > Submit Feedback.
Also, is there a chance you might also be using multiple layouts folders like I am?
I've got the same issue.
I was solved this with
File --> Invalidate Caches and Restart --> Invalidate and Restart.
And than try to rename again.
Hope this help.
Happy coding :)
I was able to work around it temporarily by moving my R.java file into my src directory. For example, if you're package name is com.example.sample, move your R.java file from app/build/generated/source/r/debug/com/example/sample/R.java to app/src/main/java/com/example/sample/R.java. Be sure to delete it when you're finished refactoring, it will be regenerated during the build process.
Cleaning doesn't work for everything. For instance, renaming a view isn't possible because the R.java file is automatically regenerated. I tried disabling Instant Run, but that didn't help either. Eventually I had to rename the view manually in the layout file.
From the comments on the bug ticket at https://issuetracker.google.com/issues/65032914 the fix will be in the beta 5 release of Android Studio.
I recently finished a solution composed by 2 project. For this 2 project I have the .exe build, but I don't know how to do the exe of solution with VS 2012. Someone know how to do it?
When you compile & build a solution, the .exe that is created is placed into the folder relating to your current build configuration, usually either Debug or Release.
So navigate to the folder, on disk, using Windows Explorer, where the solution is stored, and look in the Debug folder. The compiled program is there.
If this is not what you are after, please post more details about these two projects and how they 'tie together'.
I am using IDEA - 11.1.1 and gradle - gradle-1.0-milestone-9 (I tried with release candidate 3 also) on windows-7 (if this matters)
After importing gradle porject, IDEA complains about String object. I think I am missing something about grrovy configuration. I have also marked - main and test folder as Sources and Test Resources respectively. Did I miss something obvious?
Most likely the JDK isn't set correctly in IDEA. Go to File -> Project Structure -> Project and check/fix Project SDK.
Try checking your project and module sdk.
On your module select F4 or Right click "Open Module Settings"
Check your SDK and Moduel SDK
I am sure that will resolve your problem.
Check your IDEA project settings and look if your JDK is configured properly.
I suggest you use the gradle idea plugin to create your IDEA project files, instead of using the import function of existing gradle projects into IDEA, since from my experience it gave me troubles. Also adding new jars via gradle and updating your IDEA project files via gradle seems more consistent.
I uploaded a build.gradle gist, which might give you a good start:
https://gist.github.com/1580234
It contains some explanatory comments.
Greets,
Jan