Android Studio
Installing ANDROID STUDIO
Installation of the
android studio is as follows .
Steps for the installation of the android studio
2)
Before installation make sure java is installed
or not and if not then Download
Oracle java latest version.
3)
Now install the android studio and follow the wizard
There are two cases from which we can go
through
1)
If we have the sdk of android
studio then we can reference it while installation of the android studio
while the other one is
2)
Android studio will install the latest version
by default for us for the development of the android application.
Now wait for the
android studio to be configured for us.
Steps For Migration
There are two ways for the migration of any eclipse android
application to android studio
·
Eclipse
Gradle creation
Steps are -
1)
Open Eclipse
2)
Select Project
3)
Right Click and then Select EXPORT a dialog will appear and then select the android option and
then choose generate gradle build file as indicated in fig (1.1).
4)
And then proceed to the wizard.
5)
And so at the end of the finish operation ,
there is gradle file created in the workspace (if path is not changed )
6)
Then at the end we have to open eclipse and
select our gradle file from the workspace path.
7)
And the rest of mapping and other stuff is
maintained by the Android studio.
8) Finally
the project will be migrated to android studio (if not fix dependencies issues)
fig 1
·
Migration
from the Android studio
We have followed this way to migrate our whole
project to android studio.
Steps
are –
1)
Open Android studio
2)
Select option form quick start Import Project (Eclipse ADT, gradle, etc.)
3)
Then selecting project from the path.
4)
Now android studio will create all the basics to
change our build to gradle while this migration changes our whole project
structure to gradle structure.
5)
Now managing our dependency which we have done
for the eclipse project (Important step)
fig 2
7)
Now after resolving the dependencies configuring
our project to the android studio theme.
COMMON ERRORS While importing
1)
Could not access the package manager. Is the
system running?
Solution: - build error this and
restart and check for the same
2)
Manifest Merging Failed
Solution: android {
defaultConfig {
minSdkVersion 10
targetSdkVersion 16}
Add this in build.gradle file inside app
3)
Missing ‘Application’ Error
Solution: - found this
solution from stackoverflow.
4)
Importing Android Libraries
Solution: - this
is the solution.
5)
Install missing platforms fig.3 reflect the
same
6)
Most Important errors which are coming inside
our application is of external libraries which we are using inside our
projects. And android studio is smart enough to find the issues and after
disabling those sorts of libs it is ok but our project have the errors wherever
we have used these libs.
Solution: - Ongoing
7)
Another problem which we are facing is the build system problem with our code which
is indicated in the fig .3
fig 3
fig 4
8)
Time Out problem with the slow building process.
Solution: - we have to create a gradle.properties in the root directory in android studio . And add this in the file. And build it again. org.gradle.parallel=true org.gradle.daemon=true
9) Local path not found error
Solution: - Just sync and build the app and make sure preferences in the module setting and their path
10) Error
because of more than 6536 methods in the code in our projects
Solution: - Adding the setting in build.gradle in app like below
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
Increasing the size of heap for the compiler
11) Gradle 'All Sport' project refresh failed
12)
Coding
standard problem with the new setting of the android lint like constructor
calling and not proper following of the guidelines
of java and android application development.
13) Most Common Errors:
Execution failed for task ':app:processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\xxxxx\sdk\build-tools\21.0.1\aapt.exe'' finished with non-zero exit value 1
Execution failed for task ':app:processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\xxxxx\sdk\build-tools\21.0.1\aapt.exe'' finished with non-zero exit value 1
0 comments:
Post a Comment