Auties00 / Cobalt

Standalone unofficial fully-featured Whatsapp Web and Mobile API for Java and Kotlin
MIT License
611 stars 179 forks source link

Cant't build app in version 0.0.5 #474

Closed KanzakiisYU closed 2 months ago

KanzakiisYU commented 2 months ago

build.gradle

plugins {
    id 'com.android.application'
}

android {
    namespace 'com.konjousoft.whatsappbot'
    compileSdk 34

    defaultConfig {
        applicationId "com.konjousoft.whatsappbot"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.11.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'com.github.auties00:cobalt:0.0.5'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    annotationProcessor 'com.github.auties00:cobalt:0.0.5'

}

settings.gradle

pluginManagement {
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://releases.aspose.com/java/repo/"
        }
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://releases.aspose.com/java/repo/"
        }
        maven {
            url "https://www.jitpack.io/"
        }
    }
}

rootProject.name = "WhatsApp Bot"
include ':app'

The Error: image

 > Could not resolve com.github.auties00:cobalt:0.0.5.
     Required by:
         project :app
      > Could not resolve com.github.auties00:cobalt:0.0.5.
         > Could not parse POM https://repo.maven.apache.org/maven2/com/github/auties00/cobalt/0.0.5/cobalt-0.0.5.pom
            > Content is not allowed in prolog.

image

Darker935 commented 2 months ago

Fixed on #477

ByteAge commented 2 months ago

Not fixed yet!

Update: For anyone that have problem with gradle do this:

step 1: Open this file: C:\Users\Legobyte\.gradle\caches\modules-2\files-2.1\com.github.auties00\cobalt\0.0.5\8e7fb8d878068b581315dd274413b5603296f863\cobalt-0.0.5.pom using notepad file name is "cobalt-0.0.5.pom" so you can search it instead of manually finding it(I'm using Everything Search).

step2: Remove the first character in the file and save it. there is a space character before "<?xml version="1.", that's the problem. Result: before: <?xml version="1., after: <?xml version="1.

step3: Rerun the gradle and it should be fine now.

Happy Coding 😊!

XomaDev commented 2 months ago

@ByteAge thanks for that, unfortunately on linux, it seems to immediately delete the cache files :(