Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build the project #24

Open
lbialy opened this issue Nov 27, 2017 · 9 comments
Open

Can't build the project #24

lbialy opened this issue Nov 27, 2017 · 9 comments

Comments

@lbialy
Copy link

lbialy commented Nov 27, 2017

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
Copy link

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

@dsebastien
Copy link

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
Copy link

belrvn commented Mar 26, 2018

Any changes regarding this issue?

@adin234
Copy link

adin234 commented Apr 10, 2018

forget about the projecgt @Belka1000867 i think it is abandoned

@ravidsrk
Copy link
Member

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

@ravidsrk
Copy link
Member

@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
Copy link
Member

@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
Copy link

adin234 commented Apr 11, 2018

@ravidsrk does connectedAndroidTest work when that site is used?

@lobo78
Copy link

lobo78 commented Apr 11, 2018

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.

  • What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 32s
20 actionable tasks: 20 executed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants