Thursday, 15 December 2016

Publish my Android Studio 2.2.2 Library to GitHub Repository at first time commit/push.

- Click the VCS menu option and click the Enable version control Integration and select the git from drop down inside vcs dialog.
( select a version control system to associate with the project root: Git)
- then, Right click on Android Studio 2.2.2 Project and drop down showing and click git and select for Add button.
- then, all project source codes synced with local git hub repository.
-then, again, click VCS->import into version control->share project on GitHub
-the, Enter Master password dialog will come, enter your password of git-hub.
-if you are connected with proxy means, error will come and failure to publish.
- use direct internet, then, proceed with same for above steps.
-then, share project on GitHub window will come , it will show like
New repository name
remote name
description
-the, verify all those details and click share button, then, completed project code will synced with GitHub repository.
- if you want to see means, go git hub website and see the project code.
 GitHub

Publish my Android Studio Library to Jitpack Repository

- Just syncronize the github code to jitpack repo using git authorization
- select the project and click the build and commit
- then, will show SNAPSHOT button, when click that button
- page will scrolldown and showing the jitpack url and dependencies compile release url

Android Studio 2.2.2 Repeated Error Scenarios

4).* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method embedded() for arguments [project ':submoduleproj'] on object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

solution:
enable the fat aar plugin above dependency url, while taking the fat aar build
apply from: 'https://raw.githubusercontent.com/adwiv/android-fat-aar/master/fat-aar.gradle'
dependencies{
}


5).There are three steps need to follow the fat aar build taking.
-comment application plugin in app module build.gradle
-then, below , enable apply plugin: 'com.android.library'
-comment the application package id
-then,apply this plugin above dependencies
apply from: 'https://raw.githubusercontent.com/adwiv/android-fat-aar/master/fat-aar.gradle'
- https://github.com/adwiv/android-fat-aar use this link and download the fat-aar.gradle and paster your project.
-then, give gradle sync. check the compilation errors if anything found
- the follow the command for taking fat aar build
gradlew clean
gradlew build
- then, check the build\output\aar folder
- then convert the aar to zip and check the classess and libs are properly merged with main classess or not.
http://stackoverflow.com/questions/27486506/how-to-include-an-android-library-module-in-another-library

6). classes.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:app:compileReleaseJavaWithJavac FAILED

solution:
I am also faced this error. dont know, how to fix it.
my same code another project is running,there is no error.
but, same code,another project getting above error.some rare case, go for new project, copy all code to new project with new workspace.

Android Studio 2.2.2 Repeated Error Scenarios


3).Error:(55, 0) Could not find method embedded() for arguments [project ':submoduleproj'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

solution:
For normal running submodule given as compile, but, when we build as fat aar means, need to change as embedded instead of compile
(then only, need to combine the main submodule classes and jars are going to merge with main aar classess)

Android Studio 2.2.2 Repeated Error Scenarios:


1).
Android Studio 2.2: while uploading our Project to bintrayupload, need to comment the application id ( package name: com.test.main )
What went wrong:
A problem occurred configuring project ':app'.
> Library projects cannot set applicationId. applicationId is set to 'com.test.testproj16' in default config.

solution:
comment the application id in app build.gradle

2).Error
Error:Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Exception parsing classes
Error:1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process

solution:
=just disabled instantrun- uncheck the instant run hot swap to