Android Studio won't import Porcupine project - android

When I do File > New > Import Module and select the porcupinemanager module, which looks like this:
It tells me it also needs to import the module called porcupine (which i don't know where it is).
I get an empty directory in my Android Studio project:
This gets added into my settings.gradle:
include ':app', ':porcupine'
I still can't access any of the classes.
In settings.gradle ':porcupine' is there, even though porcupine doesn't exist.
How do I import this library properly? Here's the repo:
https://github.com/Picovoice/Porcupine

import the whole project from outside folder or add sdk tools

It seems the issue is with the Android Plugin Version under Project Structure --> Project might be different to the version of your plugins all used. Once you align them to the same version, you could see all your classes from your imported module.

I had the same issue. Depending on what you want to achieve, you have to import either the Activity or the Service directory.

Related

import project from eclipse to android studio maintaining project directory

Finally I thought of migrating my android project from Eclipse to Android studio. But importing the project by generating gradle build file from eclipse wasn't helpful. The project structure is as in figure and these are the things I followed:
Generate gradle build file of project in Eclipse. Import Eclipse ADT project. As, you can see from figure Android-project is my main project containing manifest file and resources.
The barcode-common and common contains java classes which are required in main project(i.e. Android-Project). So, I created module or import existing module in Android Studio. In settings.gradle of main-project I written as
include ':app', ':common', ':barcode-common'
And in build.gradle of main-project as
implementation project (':common')
implementation project (':barcode-common')
This works fine. But I dont want common and barcode-common to be inside main-project as I want to maintain the project directory as in figure. So, in settings.gradle of main-project I written as
include ':app', ':common'
project(':common').projectDir= new File('..\\common')
In this case I can't import any java class from common or barcode-common to main-project. Its not recognizing the java class.
So, any alternative or solution for this will be very helpful. I am struggling on this. Thanks
P.S: I want to maintain the project structure as shown in figure as common and barcode-common files are even shared by another project.

Parse UI not being found when syncing gradle

screenshot of my problem
Hi guys!
There has been a recent problem regarding the ability to import the ParseImageView class in Android Studio and there is currently only one solution: Unable to import ParseImageView - Android.
When trying this solution, it asks to download a ParseUI-Widget file from github and then import that project into my current project and then finally add a dependency for the ParseUI in the build.gradle. When attempting to sync the gradle, the error in the screenshot keeps on popping up no matter where I place the ParseUI-Widget file in the project file directory.
Please Help!
Thanks
Few things to check.
Make sure that this is the content you have inside your ParseUI-Widget.
Move your ParseUI-Widget up one directory. This way it is the same level as app
You also need to edit your settings.gradle. Your settings gradle likely looks like this:
include ':app'
Edit it to look like this:
include ':app', ':ParseUI-Widget'
You have two options:
You currently have ParseUI-Widget within the app/ directory. So you should be including it in your top-level settings.gradle file as :app:ParseUI-Widget, and within your build.gradle as compile project(':app:ParseUI-Widget')
You can also move the entire app/ParseUI-Widget directory one directory up, so that it's in the same directory, side by side with your app/ directory.
From your screenshot, it seems you haven't imported the ParseUI-Widget module. Rather you just cloned the project from github and pasted it in your project directory structure.
What you have to do is,
go in your android studio project structure view,
right click and under new,
click on new module and then
import the ParseUI-Widget as module.
Then those dependencies are in build. gradle will work fine.

How to add library project to an existing android project in AndroidStudio

how can I add a custom library project (in my example the CuXtomCam library) to an existing android project using Android Studio 1.1?
I've read about changing the build.gradle file. But where should I place the library ressources?
Thank you in advance for all answers and comments!
To import library into Android Studio:
select File > Import, and then select the directory containing the project to import.
a wizard will open and guide you through the rest of the import process.
When the project import has finished, it will open up a file called "import-summary.txt" which lists all the steps taken during import and suggestions for next steps. For example, it may note files that were not migrated, it may note missing components in your SDK install, and so on.
Just right click on the project then New>Module. from the new window select Import existing project. Give the directory. I think this will help

OpenCV Android Studio Set-up problems

I am trying to use opencv in android studio but am having some problems. I have searched the forums but couldn't find this exact problem. I am clicking file > import module and entering the following file path: OpenCV-2.4.10-android-sdk\sdk\java
I then receive an import summary like this:
ECLIPSE ANDROID PROJECT IMPORT SUMMARY
Ignored Files:
The following files were not copied into the new Gradle project; you
should evaluate whether these are still needed in your project and if
so manually move them:
javadoc\
javadoc\allclasses-frame.html
javadoc\allclasses-noframe.html
javadoc\constant-values.html
javadoc\help-doc.html
javadoc\index-all.html
javadoc\index.html
javadoc\org\
...
the summary includes a lot more libraries that are not included but I didn't want to list pointless additional information.
...
Moved Files:
Android Gradle projects use a different directory structure than ADT
Eclipse projects. Here's how the projects were restructured:
AndroidManifest.xml => openCVLibrary2410\src\main\AndroidManifest.xml
lint.xml => openCVLibrary2410\lint.xml
res\ => openCVLibrary2410\src\main\res\
src\ => openCVLibrary2410\src\main\java\
src\org\opencv\engine\OpenCVEngineInterface.aidl => openCVLibrary2410\src\main\aidl\org\opencv\engine\OpenCVEngineInterface.aidl
Next Steps:
You can now build the project. The Gradle project needs network
connectivity to download dependencies.
Bugs:
If for some reason your project does not build, and you determine that
it is due to a bug or limitation of the Eclipse to Gradle importer,
please file a bug at http://b.android.com with category
Component-Tools.
(This import summary is for your information only, and can be deleted
after import once you are satisfied with the results.)
Can anyone help me with this issue please?
Even if ".html" files are not copied the code will work.
Instead of importing path:"OpenCV-2.4.10-android-sdk\sdk\java" import any one of the samples from the opencv sdk 4 android and the libraries will be imported automatically eg:-(path:"OpenCV-2.4.11-android-sdk\OpenCV-android-sdk\samples\15-puzzle") then you can always remove the module from properties.

Can't import library project into Android Studio project

I'm writing a library project to create a component that's going to be used in some, if not all, of our projects. I wanted to test how it's going so far, but I can't import the library project into my other project.
So, I created my library project called SplashScreen with Android Studio. Now I've created the project SplashScreenDemo with an Activity that should use the component I wrote in the library project. But the import wizard doesn't let me choose the project and all the info I find online is to import into Android Studio your old Eclipse library project, but in my problem Eclipse isn't involved at all.
So far I've tried:
Right click on project root > New > Module > Import Existing Project
File > Import Project
File > Import Module
This is the window (and that's the path to my library project):
I've tried several paths, none of them working:
/Users/dgc/AndroidStudioProjects/SplashScreen
/Users/dgc/AndroidStudioProjects/SplashScreen/SplashScreen.iml
/Users/dgc/AndroidStudioProjects/SplashScreen/build.gradle
/Users/dgc/AndroidStudioProjects/SplashScreen/app
/Users/dgc/AndroidStudioProjects/SplashScreen/app/app.iml
/Users/dgc/AndroidStudioProjects/SplashScreen/app/build.gradle
Any ideas? Am I missing something?
P.S.: Versions:
Android Studio 0.6.1
gradle 1.10
Android plugin 0.11.+
I think what's happening is that you're trying to import a module that has the same name as an existing module and it's not giving you any indication of what's wrong. Actually, if you enter just the path to the parent project so it will show you a list of modules you can import, and those modules can't be selected if you hover over one, it will show you the error message in a tooltip:
Obviously that's not very helpful, and I've filed a bug asking for improvements:
https://code.google.com/p/android/issues/detail?id=71942
To work around it, you'll have to rename either the module you're trying to import or the module in your project. To do that you can right-click on it in project view, choose Refactor > Rename > Rename directory.

Categories

Resources