Kotlin Dokka - Can't find Dokka task in android studio - android

I am new to Kotlin and Dokka;
Following wikis and tutorials I've tried to setup my project for dokka documentation tool with the following lines in gradle build files:
In project gradle file:
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.15"
In module gradle file:
apply plugin: 'org.jetbrains.dokka-android'
Android studio version is 2.3.3
After Sync, project rebuild and Android studio restart I expected a dokka task appear in "Tools"/"Task & Contexts"/"+ Open Task" but I can't see any.
What am I missing/doing wrong?
Thank you in advance

The dokka task should appear in the Gradle tasks list, check the Gradle panel that's on the right by default:

Related

"Module not specified" error in application project to library project conversion

I need to convert an android-studio application project to library project. For this, I have followed official documentation from https://developer.android.com/studio/projects/android-library#Convert
I.e. changed
apply plugin: 'com.android.application'
to
apply plugin: 'com.android.library'
After that, it's giving "Module not specified" error in run configuration setting. I have tried syncing gradle files, invalidating and restarting android-studio, but "Module not specified" error has not been resolved.
How to resolve this error in converting application project to library project?
It is because a library module cannot run as app.
You need to new a module(say newapp) and set its buuild.gradle apply plugin: 'com.android.application', then edit the root settings.gradle include 'newapp'.
Give it a go.
Generate the aar file by running directly the gradle build task, selecting it from the gradle tasks of the app module:

Android Studio: Can't sync Gradle Project

I am currently experiencing a strange issue with Android Studio and Gradle.
Android Studio: 3.4.2
Gradle: 2.10
When I try to sync the Android Studio Project the sync finishes in 969ms with CONFIGURE SUCCESSFUL followed by a red 1
Here is Android Studio's IDEA log
It looks like there is some kind of exception, but I can't figure out why.
Another interresting thing is that I can execute ./gradlew build --info without any issues.
The logs without the build.gradle is useless information ...
and one cannot use Gradle 2.10 with Android Studio 3.4.2
... you'd have to upgrade at least to Gradle 5.1.0.
I just stumbled over a solution by googling some of the log content.
Adding com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
after apply plugin: 'com.google.gms.google-services'
It just works!
Here is the original post: https://stackoverflow.com/a/54504968/1766321

Gradle DSL method not found: 'deleteAllActions()'

I cloned this project from github and imported it using android studio but after doing all the rounds I'm getting this error
ERROR: Gradle DSL method not found: 'deleteAllActions()'
Can anyone help me remove this error and build the project well?
You should update the version of the Retrolambda plugin. Currently, that would be 3.7.1.
So in your project's build.gradle file, make sure that you have this line:
classpath 'me.tatarka:gradle-retrolambda:3.7.1'
if you are using below dependency for multiple image selection functionality.
react-native-multiple-image-picker
then remove the below line from build.gradle of the same library.
apply plugin: 'me.tatarka.retrolambda'
If you're trying to open the project on Android Studio 3.4.x, then update your android studio to 3.5.1 and re-clone the same project. I had the same issue and after updating, it built the project successfully!
Edit: This is happening specifically when gradle is updated to 5.4.1
To stop this from happening, change this line inbuild.gradle file :
classpath 'com.android.tools.build:gradle:3.5.1'
To this :
classpath 'com.android.tools.build:gradle:2.2.2'
And change this line in gradle-wrapper.properties :
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
To this :
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip
Then sync and it will successfully sync the project
Remove dependency me.tatarka:gradle-retrolambda from build.gradle in data module.

Can not add com.github.dcendents.android-maven

I tried to upload my code to bintry so that I can connect it to jcenter but the problem occurs when I add this line to my library build.gradle:
apply plugin: 'com.github.dcendents.android-maven'
gradle can not be build, what did I wrong?
I had the same issue. I was using gradle 2.4.
I don't know why but by downgrading gradle to 2.2.1 it get solved.
Just go to File then Project Settings and write in gradle field 2.2.1.

Android Gradle build and circular dependency

I have an Android project in IntelliJ IDEA. It consists of two modules: app and library. App depends on library and library depends on app (Yes, it's not good, but I have what I have and can't change this). IDEA in project settings warn me about circular dependencies, but project builds correctly. Project structure looks like this:
project
|__app
| |__src
| |__build.gradle
|__libarary
| |__src
| |__build.gradle
|__build.gradle
|__settings.gradle
Now I'm trying to migrate to new Android build system based on Gradle and have a trouble here. In my build.gradle from app module I add dependency on library
compile project(":library")
Also I tryed to add dependency in library on app like
compile project(":app")
But gets error from build system, when gradle trys to assemble library module:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> Module version project:app:unspecified depends on libraries but is not a library itself
What I can do with this without changing project structure
This parameters have changed.
You should now refactor:
In the library project use:
apply plugin: 'com.android.library'
In the app project use:
apply plugin: 'com.android.application'
In the library project use:
apply plugin: 'android-library'
In the app project use:
apply plugin: 'android'
Make sure you have the newest Android tools:
classpath 'com.android.tools.build:gradle:0.5.+'
If you arrive here searching for the same error with Android 3.0 you should know the current workaround is:
downgrade to kotlinVersion = '1.1.2-2'
and disable incremental build in gradle.properties kotlin.incremental=false
The issue is planned for the next alpha https://issuetracker.google.com/issues/38447344

Categories

Resources