Importing Eclipse project to Android Studio 0.8.14 - android

I am having huge problems migrating since I am doing it on a big project.
I have: Beta 0.8.14 installed (latest version)
I generated build.gradle from eclipse and imported to android studio. I tried running it but there where no modules so after some googling I tried adding module but got an error:
Error:The project is using an unsupported version of Gradle.
Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
Tried again with gradle wrapper and this happened:
10:31:24 AssertionError: Already disposed: Module: 'appName': Already disposed: Module: 'appName'
10:31:30 AssertionError: Already disposed: Module: 'appName': Already disposed: Module: 'appName'
And now I am stuck.
I tried importing normal project as well (without the build.gradle file) and I got the same result.
I don't know what I am doing wrong, I tried multiple tutorials and none worked. The project is fairly large. The reason I am migrating to android studio is to use android-support-multidex that only works with gradle.

I updated android studio to 0.9.3 and it works now.

Related

Android Studio 4.4.2. Direct local .aar file dependencies are not supported when building an AAR

Everything was fine, but after the next build I got some errors.
Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :app project caused this error
implementation files('libs/lib1.aar')
implementation files('libs/lib2.aar')
I don't have the source for these libraries, so I cannot connect them as modules. How can I solve those problems?
Thank you in davance.
I got this error when I used the "Rebuild Project" option in AndroidStudio. When I used the "Build Project" options instead the error disappeared
I have faced same issue,i tried with add module but not working so i changed my build tools gradle dependency version from 4.2.2 to 3.6.1 and this solution is working with if add .aar file in libs folder because gradle tools version more than 4.0.0 is not supported local .aar files.
classpath 'com.android.tools.build:gradle:3.6.1'

project Root project "Gradle project not found for Module: "MyApplication"

My new Android studio version is giving below error for the sample project could you please help?
Below is the logs for IDE Fatal Error i got
IDE Error
Root project path of the Gradle project not found for Module: 'MyApplication2'
com.intellij.openapi.diagnostic.Logger$EmptyThrowable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:140)
at org.jetbrains.plugins.gradle.execution.GradleOrderEnumeratorHandler.addCustomModuleRoots(GradleOrderEnumeratorHandler.java:110)
at com.android.tools.idea.gradle.project.AndroidGradleOrderEnumeratorHandlerFactory$1.addCustomModuleRoots(AndroidGradleOrderEnumeratorHandlerFactory.java:93)
at com.intellij.openapi.roots.impl.OrderEnumeratorBase.addCustomRootsForModule(OrderEnumeratorBase.java:422)
at com.intellij.openapi.roots.impl.OrderRootsEnumeratorImpl.collectModuleRoots(OrderRootsEnumeratorImpl.java:238)
at com.intellij.openapi.roots.impl.OrderRootsEnumeratorImpl.lambda$computeRoots$0(OrderRootsEnumeratorImpl.java:108)
at com.intellij.openapi.roots.impl.OrderEnumeratorBase.processEntries(OrderEnumeratorBase.java:303)
at com.intellij.openapi.roots.impl.ModuleOrderEnumerator.forEach(ModuleOrderEnumerator.java:47)
at com.intellij.openapi.roots.impl.OrderRootsEnumeratorImpl.computeRoots(OrderRootsEnumeratorImpl.java:104)
at com.intellij.openapi.roots.impl.OrderRootsEnumeratorImpl.getRoots(OrderRootsEnumeratorImpl.java:74)
at com.intellij.openapi.roots.OrderEnumerator.getClassesRoots(OrderEnumerator.java:159)
Because of this error Gradle build is getting failed Gradle error screen shot attached
Also in Project structure required files are not getting generated
for example: Application specific build.gradle Project structure picture attached
PS: Android studio version is 3.1.4
I had the same problem and solved it by below methods.
I don't know what OS you are running, but mine is macOS High Sierra, and
Android Studio version is same as yours. (v 3.1.4)
First thing I tried, and it worked.
I changed the gradle version to 4.2 and re-opened the project.
File -> Project Structure -> Project -> Gradle version from 4.4 to 4.2
I changed the gradle version from 4.2 to 4.4 again.
I closed the project and re-opened it after I deleted the gradle on the below directory.
/Users/$USERNAME/.gradle/wrapper/dists/GRADLE_VERSION

Can't resolve libraries after importing project from different computer

after importing my project from my old computer to my new computer gradle fails to build.
My best guess is that it has to do with using the alpha 28 library. Since a previous version of the project that doesn't will still build
def SLVersion = '28.0.0-alpha3'
implementation "com.android.support:recyclerview-v7:${SLVersion}"
implementation "com.android.support:cardview-v7:${SLVersion}"
implementation "com.android.support:appcompat-v7:${SLVersion}"
implementation "com.android.support:support-v4:${SLVersion}"
implementation "com.android.support:design:${SLVersion}"
I've tried copying most of the files from my Android folder and AppData folder hoping it gets it to work, but it still doesn't
I get the error
Failed to resolve: design
Open File
Failed to resolve: recyclerview-v7
Open File
And so on and so on with the libraries. So i want to use my new computer, but this has been holding me up for a few weeks. Out of ideas so if anyones got suggestions they are appreciated
I had a similar problem that took ages to solve, in the end I deleted the caches inside the ~/.gradle folder and downloaded dependencies again.
API 28 alpha 3
Gradle Version: 4.4
Android Plugin Version: 3.1.3

Import a project to Android studio faced problems

I want reading an open source project so I select k9mail for start. The recommendation was run and reading this code in Android Studio. I import k9mail project to AS 1.2.1.1 version. I download gradle 2.4 version and added this in environment variable. When I want to run this application, but I receive some errors that I describe below:
1) When I click Run (Alt+Shift+F10), select Android Application, select my module (there is k9mail) and select USB Device, then I see a warning:
No JDK specified for module 'k-9-master'.
2) When I click on Run (Shift+F10), I faced this error in messages tab:
Gradle DSL method not found: 'android()'
Possible causes:
A)The project 'k-9-master' may be using a version of Gradle that does not contain the method.Open Gradle wrapper file
B)The build file may be missing a Gradle plugin. Apply Gradle plugin
When I updated gradle to 2.4, I changed classpath 'com.android.tools.build:gradle:1.2.3' to 'classpath 'com.android.tools.build:gradle:2.4'' from build.gradle of k9mail, but my problems were not solved.
I googled but I can't find solutions for my problems.
No jdk specified for the module.
For that you have to specify the jdk path through Project Structure.
You may also verify by looking at local.properties
For gradle related issues you just kindly update your gradle build and SDKs to latest versions.
This will minimize your gradle issues.

Android Studio 0.4.3 - Unable to compile official Android Samples

I've got Android Studio 0.4.3 installed on my system and try to import and run the official samples from the Android Developers site:
http://developer.android.com/samples/index.html
Unfortunately when I try to compile I get the following error:
FAILURE: Could not determine which tasks to execute.
What went wrong: Task 'assemble' not found in root project 'ActionBarCompat-Basic'.
Try: Run gradle tasks to get a list of available tasks.
As you can see I tried to compile the ActionBarCompat-Basic example, but the result is the same for all samples.
I already tried to delete the <component name="FacetManager"> ... </component>
from my iml file and deleted the .idea folder like suggested in this thread:
Gradle: FAILURE: Could not determine which tasks to execute
This did not solve the problem. After removal of the files I imported the project to Android Studio and tried to compile. As a consequence the iml file and the .idea folder are generated again and the error message stays the same.
Anyone else got this problem? Any help is greatly appreciated!
Sample projects are using old version of gradle plugin which is no longer supported by Android Studio 0.4.3
Please do the following changes
Go to your module's build.gradle(like ActionBarCompat-BasicSample/build.gradle) file inside the project and replace dependency classpath at beginning by this
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
Change the distrubutionUrl in ActionBarCopat-Basic/gradle/gradle-wrapper.properties file to this
distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip
If you are using gradle version 1.10 replace 0.7.+ to 0.8.+ and 1.9 to 1.10 in above configurations .
I am assuming you have already removed component FacetManager from ActionBarCopat-Basic.iml file and re-imported the project.
This worked perfectly for me.

Categories

Resources