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

Gradle build error #1715

Open
bitsandfoxes opened this issue Jul 8, 2024 · 0 comments
Open

Gradle build error #1715

bitsandfoxes opened this issue Jul 8, 2024 · 0 comments
Labels
Bug Something isn't working Editor Platform: Android

Comments

@bitsandfoxes
Copy link
Contributor

Building a game with the following main gradle template

apply plugin: 'com.android.library'
**APPLY_PLUGINS**

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}

android {
    ndkPath "**NDKPATH**"

    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    defaultConfig {
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
        consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
    }

    lintOptions {
        abortOnError false
    }

    aaptOptions {
        noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**PACKAGING_OPTIONS**
}
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**

leads to the following error

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Projects\OPne\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\build.gradle' line: 81

* What went wrong:
Could not compile build file 'C:\Projects\OPne\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\build.gradle'.
> startup failed:
  build file 'C:\Projects\OPne\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\build.gradle': 81: Unexpected input: '{' @ line 81, column 15.
     afterEvaluate {
                   ^

This is the generated output:

apply plugin: 'com.android.application'

dependencies {
    implementation project(':unityLibrary')
}

android {
    ndkPath "C:/Program Files/Unity/Hub/Editor/2022.3.34f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK"

    compileSdkVersion 31
    buildToolsVersion '32.0.0'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    defaultConfig {
        minSdkVersion 22
        targetSdkVersion 31
        applicationId 'com.mannd.op'
        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a'
        }
        versionCode 28
        versionName '0.028'
    }

    aaptOptions {
        noCompress = ['.unity3d', '.ress', '.resource', '.obb', '.bundle', '.unityexp'] + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
    }

    signingConfigs {
        release {
            storeFile file('C:/Projects/OPne/user.keystore')
            storePassword 'hellow'
            keyAlias 'com.mannd.op'
            keyPassword 'hellow'
        }
    }

    lintOptions {
        abortOnError false
    }

    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt')
            signingConfig signingConfigs.release
            jniDebuggable true
        }
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt')
            signingConfig signingConfigs.release
        }
    }

    packagingOptions {
        doNotStrip '*/armeabi-v7a/*.so'
        doNotStrip '*/arm64-v8a/*.so'
    }

    bundle {
        language {
            enableSplit false
        }
        density {
            enableSplit false
        }
        abi {
            enableSplit true
        }
    }
}

// Autogenerated Sentry symbol upload task [start]
// Credentials and project settings information are stored in the sentry.properties file
afterEvaluate {
    task sentryUploadSymbols {
        doLast {
            println 'Uploading symbols to Sentry. You can find the full log in ./Logs/sentry-symbols-upload.log (the file content may not be strictly sequential because it\'s a merge of two streams).'
            def logFilePath = 'C:/Projects/OPne/Logs/sentry-symbols-upload.log'
            def sentryLogFile = new FileOutputStream(logFilePath)
            exec {
                environment 'SENTRY_PROPERTIES', './sentry.properties'
                executable 'C:/Projects/OPne/Library/PackageCache/io.sentry.unity@912a177efe/Editor/sentry-cli/sentry-cli-Windows-x86_64.exe'
                args = ['debug-files', 'upload', '--il2cpp-mapping', 'C:/Projects/OPne/Library/Bee/artifacts/Android', 'C:/Projects/OPne/Library/Bee/Android']
                standardOutput sentryLogFile
                errorOutput sentryLogFile
            }
            println 'Uploading mapping file to Sentry.'
            def mappingLogFilePath = 'C:/Projects/OPne/Logs/sentry-mapping-upload.log'
            def mappingLogFile = new FileOutputStream(mappingLogFilePath)
            exec {
                environment 'SENTRY_PROPERTIES', './sentry.properties'
                executable 'C:/Projects/OPne/Library/PackageCache/io.sentry.unity@912a177efe/Editor/sentry-cli/sentry-cli-Windows-x86_64.exe'
                args = ['upload-proguard', 'C:/Projects/OPne/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/outputs/mapping/release/mapping.txt']
                standardOutput mappingLogFile
                errorOutput mappingLogFile
            }
        }
    }

    tasks.assembleDebug.finalizedBy sentryUploadSymbols
    tasks.assembleRelease.finalizedBy sentryUploadSymbols
    tasks.bundleDebug.finalizedBy sentryUploadSymbols
    tasks.bundleRelease.finalizedBy sentryUploadSymbols
}
// Autogenerated Sentry symbol upload task [end]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Editor Platform: Android
Projects
Status: Todo
Development

No branches or pull requests

2 participants