androidstarters / kotlin-android-starter

[Kotlin Android] Kotlin Android starter based MVP/Dagger2/RxJava2/Robolectric/Espresso/Mockito. It provides a generator to fast create a Kotlin Android project.
601 stars 94 forks source link

Can't build the project #24

Open lbialy opened 6 years ago

lbialy commented 6 years ago

Hi,

I have used your yeoman template as described in docs, but it seems that build is broken, as I can't execute ./gradlew script - it fails with:

$ ./gradlew
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

I have tried running it on two OSes, Linux and Mac OS X, I have gradle installed globally on Linux box (4.3.1) and it fails in project with exception telling me: Error: FOR_COMPILE. I don't have global gradle on Mac OS X. End result is the same on both.

interkenny commented 6 years ago

./gradlew clean app:assembleDebug The same error. Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

dsebastien commented 6 years ago

In my case the contents of the gradle/wrapper folders were wrong for some reason (empty gradle-wrapper.properties and gradle-wrapper.jar files)

But after that I stumbled upon another error:

Caused by: java.lang.NoSuchFieldError: FOR_COMPILE
        at com.android.build.gradle.internal.dependency.VariantDependencies$Builder.build(VariantDependencies.java:254)
        at com.android.build.gradle.internal.VariantManager.createVariantDataForVariantType(VariantManager.java:831)
        at com.android.build.gradle.internal.VariantManager.createVariantDataForProductFlavorsAndVariantType(VariantManager.java:1059)
        at com.android.build.gradle.internal.VariantManager.createVariantDataForProductFlavors(VariantManager.java:992)
        at com.android.build.gradle.internal.VariantManager.populateVariantDataList(VariantManager.java:682)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
        at com.android.build.gradle.internal.VariantManager.createAndroidTasks(VariantManager.java:321)
        at com.android.build.gradle.BasePlugin.lambda$createAndroidTasks$8(BasePlugin.java:615)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
        at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:610)
        at com.android.build.gradle.BasePlugin.lambda$null$6(BasePlugin.java:537)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
        at com.android.build.gradle.BasePlugin.lambda$createTasks$7(BasePlugin.java:533)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:91)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
        ... 100 more
belrvn commented 6 years ago

Any changes regarding this issue?

adin234 commented 6 years ago

forget about the projecgt @Belka1000867 i think it is abandoned

ravidsrk commented 6 years ago

@adin234 @Belka1000867 I will look into this today. Will update on the thread.

ravidsrk commented 6 years ago

@adin234 @Belka1000867 @dsebastien I am getting BUILD SUCCESSFULL. Need more information and steps to reproduce the issues you guys are facing.

Here is my logs:

❯ ./gradlew clean app:assembleDebug
Parallel execution with configuration on demand is an incubating feature.
app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.android.databinding:compiler:3.1.1'.
:clean
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:transformDataBindingBaseClassLogWithDataBindingMergeGenClassesForDebug
:app:dataBindingGenBaseClassesDebug
:app:checkDebugManifest
:app:generateDebugBuildConfig
:app:prepareLintJar UP-TO-DATE
:app:mainApkListPersistenceDebug
:app:createDebugCompatibleScreenManifests
:app:processDebugManifest
/Users/ravindra/github/kotlin-android-starter/app/src/debug/AndroidManifest.xml:14:5-50:19 Warning:
    application@android:label was tagged at AndroidManifest.xml:14 to replace other declarations but no other declaration present
:app:splitsDiscoveryTaskDebug
:app:processDebugResources
:app:generateDebugSources
:app:dataBindingExportBuildInfoDebug
:app:kaptGenerateStubsDebugKotlin
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /Users/ravindra/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.31/98678431965f7487d6dc9b399e59b6c4b3921073/kotlin-stdlib-jre7-1.2.31.jar (version 1.2)
    /Users/ravindra/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.1.1/e68cf130c2dbdd68a72f4a750cf442dffcd877ce/kotlin-reflect-1.1.1.jar (version 1.1)
    /Users/ravindra/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.2.31/153dcd9ed9db246a7e36f4d7609e2a9f4718c674/kotlin-stdlib-1.2.31.jar (version 1.2)
w: Consider providing an explicit dependency on kotlin-reflect 1.2 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath or use '-Xskip-runtime-version-check' to suppress this warning
:app:transformDataBindingWithDataBindingMergeArtifactsForDebug
:app:kaptDebugKotlin
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /Users/ravindra/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.31/98678431965f7487d6dc9b399e59b6c4b3921073/kotlin-stdlib-jre7-1.2.31.jar (version 1.2)
    /Users/ravindra/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.1.1/e68cf130c2dbdd68a72f4a750cf442dffcd877ce/kotlin-reflect-1.1.1.jar (version 1.1)
    /Users/ravindra/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.2.31/153dcd9ed9db246a7e36f4d7609e2a9f4718c674/kotlin-stdlib-1.2.31.jar (version 1.2)
w: Consider providing an explicit dependency on kotlin-reflect 1.2 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath or use '-Xskip-runtime-version-check' to suppress this warning
:app:compileDebugKotlin
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /Users/ravindra/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.31/98678431965f7487d6dc9b399e59b6c4b3921073/kotlin-stdlib-jre7-1.2.31.jar (version 1.2)
    /Users/ravindra/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.1.1/e68cf130c2dbdd68a72f4a750cf442dffcd877ce/kotlin-reflect-1.1.1.jar (version 1.1)
    /Users/ravindra/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.2.31/153dcd9ed9db246a7e36f4d7609e2a9f4718c674/kotlin-stdlib-1.2.31.jar (version 1.2)
w: Consider providing an explicit dependency on kotlin-reflect 1.2 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath or use '-Xskip-runtime-version-check' to suppress this warning
:app:javaPreCompileDebug
:app:compileDebugJavaWithJavac
:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:transformClassesWithStackFramesFixerForDebug
:app:transformClassesWithDesugarForDebug
:app:transformClassesWithDexBuilderForDebug
D8: InnerClass annotations are missing corresponding EnclosingMember annotations. Such InnerClass annotations are ignored.
D8: Stripped invalid locals information from 2 methods.
:app:transformClassesWithMultidexlistForDebug
:app:transformDexArchiveWithDexMergerForDebug
:app:mergeDebugJniLibFolders
:app:transformNativeLibsWithMergeJniLibsForDebug
:app:transformNativeLibsWithStripDebugSymbolForDebug
:app:processDebugJavaRes NO-SOURCE
:app:transformResourcesWithMergeJavaResForDebug
:app:validateSigningDebug
:app:packageDebug
:app:assembleDebug

BUILD SUCCESSFUL in 2m 11s
38 actionable tasks: 37 executed, 1 up-to-date
ravidsrk commented 6 years ago

@adin234 @Belka1000867 @dsebastien If you guys are still facing the same issues. Please use http://androidstarters.com/ to create new project using this repo.

adin234 commented 6 years ago

@ravidsrk does connectedAndroidTest work when that site is used?

lobo78 commented 6 years ago

When I used http://androidstarters.com, I get the following output after running ./gradlew check

12:10 $ ./gradlew check Parallel execution with configuration on demand is an incubating feature.

Configure project :app app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.android.databinding:compiler:3.1.1'.

Task :app:processDebugManifest /Users/######/AndroidStudioProjects/android-starters-com/app/src/debug/AndroidManifest.xml:14:5-50:19 Warning: application@android:label was tagged at AndroidManifest.xml:14 to replace other declarations but no other declaration present

w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath: /Users/######/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.31/98678431965f7487d6dc9b399e59b6c4b3921073/kotlin-stdlib-jre7-1.2.31.jar (version 1.2) /Users/######/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.1.1/e68cf130c2dbdd68a72f4a750cf442dffcd877ce/kotlin-reflect-1.1.1.jar (version 1.1) /Users/######/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.2.31/153dcd9ed9db246a7e36f4d7609e2a9f4718c674/kotlin-stdlib-1.2.31.jar (version 1.2) w: Consider providing an explicit dependency on kotlin-reflect 1.2 to prevent strange errors w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath or use '-Xskip-runtime-version-check' to suppress this warning w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath: /Users/######/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.31/98678431965f7487d6dc9b399e59b6c4b3921073/kotlin-stdlib-jre7-1.2.31.jar (version 1.2) /Users/######/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.1.1/e68cf130c2dbdd68a72f4a750cf442dffcd877ce/kotlin-reflect-1.1.1.jar (version 1.1) /Users/######/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.2.31/153dcd9ed9db246a7e36f4d7609e2a9f4718c674/kotlin-stdlib-1.2.31.jar (version 1.2) w: Consider providing an explicit dependency on kotlin-reflect 1.2 to prevent strange errors w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath or use '-Xskip-runtime-version-check' to suppress this warning w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath: /Users/######/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.31/98678431965f7487d6dc9b399e59b6c4b3921073/kotlin-stdlib-jre7-1.2.31.jar (version 1.2) /Users/######/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.1.1/e68cf130c2dbdd68a72f4a750cf442dffcd877ce/kotlin-reflect-1.1.1.jar (version 1.1) /Users/######/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.2.31/153dcd9ed9db246a7e36f4d7609e2a9f4718c674/kotlin-stdlib-1.2.31.jar (version 1.2) w: Consider providing an explicit dependency on kotlin-reflect 1.2 to prevent strange errors w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath or use '-Xskip-runtime-version-check' to suppress this warning e: /Users/######/AndroidStudioProjects/android-starters-com/app/src/main/java/com/example/features/detail/DetailActivity.kt: (60, 27): Overload resolution ambiguity: public fun ImageView.loadImageFromUrl(url: String): Unit defined in com.example.util in file AndroidUtils.kt public fun ImageView.loadImageFromUrl(url: String): Unit defined in com.example.util in file Extensions.kt e: /Users/######/AndroidStudioProjects/android-starters-com/app/src/main/java/com/example/util/AndroidUtils.kt: (13, 1): Conflicting overloads: public fun ImageView.loadImageFromUrl(url: String): Unit defined in com.example.util in file AndroidUtils.kt, public fun ImageView.loadImageFromUrl(url: String): Unit defined in com.example.util in file Extensions.kt e: /Users/######/AndroidStudioProjects/android-starters-com/app/src/main/java/com/example/util/AndroidUtils.kt: (19, 1): Conflicting overloads: public fun Activity.hideKeyboard(): Unit defined in com.example.util in file AndroidUtils.kt, public fun Activity.hideKeyboard(): Unit defined in com.example.util in file Extensions.kt e: /Users/######/AndroidStudioProjects/android-starters-com/app/src/main/java/com/example/util/Extensions.kt: (35, 1): Conflicting overloads: public fun ImageView.loadImageFromUrl(url: String): Unit defined in com.example.util in file AndroidUtils.kt, public fun ImageView.loadImageFromUrl(url: String): Unit defined in com.example.util in file Extensions.kt e: /Users/######/AndroidStudioProjects/android-starters-com/app/src/main/java/com/example/util/Extensions.kt: (41, 1): Conflicting overloads: public fun Activity.hideKeyboard(): Unit defined in com.example.util in file AndroidUtils.kt, public fun Activity.hideKeyboard(): Unit defined in com.example.util in file Extensions.kt

FAILURE: Build failed with an exception.

BUILD FAILED in 32s 20 actionable tasks: 20 executed