file or directory '<project>/<app>/src/debug/java', not found - android

My project doesn't build. I imported a third party project with library and sample module into Android Studio.
The project is here https://github.com/consp1racy/android-support-preference.git
Both modules have Build Variant set to debug. When I build the project it fails on the sample module with error message:
file or directory 'project/sample/src/debug/java', not found
Setting the build variant of sample module to release produces a similar message:
file or directory 'project/sample/src/release/java', not found
I'm puzzled. I would expect the source path to be src/main/java.
What is going on here?

The original author of the project made an update and now it builds fine with gradle from the command line.

Related

Facing Build Errors in an Android Studio Project while importing sub modules

I cloned an Android repository and added its submodules using git submodule update --init, so two more folders showed up along with the main module "app". The libnetcipher is a module of OnionKit project which was imported after the I ran the update command.
Now I'm facing build errors while running build.gradle of Onionkit project as shown below:
The local.properties file as you can see exist in the project and has correct SDK location mentioned.
Then I've tried running settings.gradle file, with following contents:
include ':app'
include ':app:libs:OnionKit:libnetcipher'
and received this error:
What might be causing this I couldn't deduce, I've never used an Andriod project importing such dependencies/sub-modules in the past.
More Information: Running build.gradle for Project:Android and Module:app executes successfully.
My thoughts : There are 2 projects open right now, which seems wrong and also the SDK path that was shown as misconfigured seems to be that of the OnionKit project.
Repository link : https://github.com/duckduckgo/Android

Unable to generate Gradle files

I have imported a project from GitHub into Android Studio, however there is not a gradlew nor gradle.bat file.
I read about how I could generate them from questions like this one, so I ran the following command in the terminal:
gradle wrapper
However, I was given an error:
'gradle' is not recognized as an internal or external command,
operable program or batch file.
Also, in Android Studio, I have set the following setting:
Build, Execution, Deployment > Build Tools > Gradle [For current project]
...
Project-level settings
[x] Use default gradle wrapper (recommended)
[ ] Use local gradle distribution...
...
So my question is, how can I resolve the error and generate the gradlew and gradle.bat files?
It seemed as though in my case, I had deleted gradle wrapper files (I was trying to edit my GitHub project by importing it to Android Studio, and I had deleted the original files that I uploaded. I accidentally put in .gitignore to not upload those files to GitHub so they weren't there when I imported the project). I found them in my recycle bin and restored them.

Unable to build titanium android module with ant

I am trying to build module with ant. I am getting below error message.
BUILD FAILED
/Users/XXXX/Library/Application Support/Titanium/mobilesdk/osx/3.4.1.GA/module/android/build.xml:163: /Users/XXXX/Documents/titanium-test-workspace/holograph/lib does not exist.
Path to module repo : TiHoloGraph
Settings in my build.properties are
titanium.platform=/Users/XXXX/Library/Application Support/Titanium/mobilesdk/osx/3.4.1.GA/android
android.platform=/Users/XXXX/Documents/android-sdk-macosx/platforms/android-19
google.apis=/Users/XXXX/Documents/android-sdk-macosx/add-ons/addon-google_apis-google-19
android.ndk=/Users/XXXX/Documents/android-ndk-r1
any help?
I've had the same problems with building modules.
Somehow ANT cannot create a lib folder in MacOS.
Just create a /Users/XXXX/Documents/titanium-test-workspace/holograph/lib folder yourself and you'll be fine

Error in third party Library addition in qt android project

I am trying to add and android library to my qt android project. But it fails while deploying.
I followed steps as given in documentation : Third-party Android Libraries
I get the error
BUILD FAILED
E:\Installations\ADT\adt-bundle-windows-x86-20131030\sdk\tools\ant\build.xml:577:
../android-build/libs/ resolve to a path with no project.properties
file for project
E:\WorkSpaces\Qt\Qt_WidgetApps\AndroidSerialPortTrials\ThirdPartyLib\build-ThirdPartyLib-Android_for_armeabi_v7a_GCC_4_8_Qt_5_3_0_Android_GCC_arm_4_8-Debug\android-build
my project.properties
android.library.reference.1=../android-build/libs/
projectPath/android/
libs/
AndroidManifest.xml
project.properties
projectPath/android/libs/
- xx.so
- yy.jar
I tried
android.library.reference.1=libs/ as given in documentation
android.library.reference.1=../android/libs/
android.library.reference.1=./libs/
But all gives error

Android Studio Error "output path is not specified for modules"

I just recently upgraded to the newest version of Android Studio (0.1.1), but I also used Android Studio to relocate my project to my Dropbox folder. So, I'm not exactly sure which one is causing this problem. When I build or try to run my project I get this error:
Cannot start compilation: the output path is not specified for modules
"actionbarsherlock",
"EmPubLite-EmPubLite".
Specify the output path in Configure Project.
I can't find any reference to "Configure Project" and the Project Structure option under File no longer works in this release.
Solution for Android Studio version < 1.0 :
You just have to go to your Modules settings > Project and specify a "Project compiler output"
and make your modules inherit from project. (For that go to Modules > Paths > Inherit project.
Or you can specify your output for each module if you want.
In order to do so you just need to follow this steps:
Open Project structure (F4 on one of the modules in the project explorer)
Click on Project tab on the left
Define "Project compiler output:" as YOUR_PROJECT_PATH\out (or any folder you want)
Click on Modules tab on the left
Go over all your modules and verify that under the Paths tab the Compiler output is set to "Inherit project compile output path"
I ended up re-importing the project using Gradle and it's back to normal. Very weird issue.
this is a problem that I face in case I open my phonegap project with Android Studio and Webstorm.
They are IntelliJ-based project and I guess they are both writing the files in .idea
Reimporting the project is the solution.
got same error while using studio feature to import from GitHub repository.
I deleted the whole project and .. cloned it using git terminal and imported as new project ... studio prompted to add VCS root, accepted ....everything was fine afterwards. As #lordhong prompted.
I found this:
http://www.chrisdew.com/blog/2013/07/17/android-studio-nosuchmethoderror-lazystringarraylist/
it is realy help for me.
Thus, in my case, the problem was to have two libraries:
protobuf-2.4.1.jar
and new protobuf-2.5.0.jar
it resulted error:
APK path is not specified for module “Example-Example”
To correct this, rename file protobuf-2.4.1.jar to protobuf-2.4.1.jar.disabled
mv protobuf-2.4.1.jar protobuf-2.4.1.jar.disabled
How I finally managed to fix after hours!
File -> Project Structure -> Facets -> choose module's facet -> Packaging. Enter in APK Path absolute path to apk to be created: C:\workspace\MyCompany\MyProject\myProject.apk
Press ok and run your project

Categories

Resources