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

error Failed build android #318

Open
1 task done
ahmedhango opened this issue Nov 15, 2024 · 2 comments
Open
1 task done

error Failed build android #318

ahmedhango opened this issue Nov 15, 2024 · 2 comments

Comments

@ahmedhango
Copy link

Current behavior

  • What went wrong:
    Could not determine the dependencies of task ':react-native-compressor:compileDebugAidl'.

Could not resolve all task dependencies for configuration ':react-native-compressor:debugCompileClasspath'.
Could not resolve org.mp4parser:isoparser:1.9.56.
Required by:
project :react-native-compressor
> Could not resolve org.mp4parser:isoparser:1.9.56.
> Could not get resource 'https://oss.sonatype.org/content/repositories/snapshots/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> adx
> Could not resolve org.mp4parser:isoparser:1.9.56.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> adx
> Could not resolve org.mp4parser:isoparser:1.9.56.
> Could not get resource 'https://dl.google.com/dl/android/maven2/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> adx
> Could not resolve org.mp4parser:isoparser:1.9.56.
> Could not get resource 'https://www.jitpack.io/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> Could not GET 'https://www.jitpack.io/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> adx
> Could not resolve org.mp4parser:isoparser:1.9.56.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> adx
> Could not resolve org.mp4parser:isoparser:1.9.56.
> Could not get resource 'https://dl.google.com/dl/android/maven2/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> adx
> Could not resolve org.mp4parser:isoparser:1.9.56.
> Could not get resource 'https://jitpack.io/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> Could not GET 'https://jitpack.io/org/mp4parser/isoparser/1.9.56/isoparser-1.9.56.pom'.
> adx
Could not resolve com.github.banketree:AndroidLame-kotlin:v0.0.1.
Required by:
project :react-native-compressor
> Could not resolve com.github.banketree:AndroidLame-kotlin:v0.0.1.
> Could not get resource 'https://oss.sonatype.org/content/repositories/snapshots/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> adx
> Could not resolve com.github.banketree:AndroidLame-kotlin:v0.0.1.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> adx
> Could not resolve com.github.banketree:AndroidLame-kotlin:v0.0.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> adx
> Could not resolve com.github.banketree:AndroidLame-kotlin:v0.0.1.
> Could not get resource 'https://www.jitpack.io/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> Could not GET 'https://www.jitpack.io/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> adx
> Could not resolve com.github.banketree:AndroidLame-kotlin:v0.0.1.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> adx
> Could not resolve com.github.banketree:AndroidLame-kotlin:v0.0.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> adx
> Could not resolve com.github.banketree:AndroidLame-kotlin:v0.0.1.
> Could not get resource 'https://jitpack.io/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> Could not GET 'https://jitpack.io/com/github/banketree/AndroidLame-kotlin/v0.0.1/AndroidLame-kotlin-v0.0.1.pom'.
> adx
Could not resolve javazoom:jlayer:1.0.1.
Required by:
project :react-native-compressor
> Could not resolve javazoom:jlayer:1.0.1.
> Could not get resource 'https://oss.sonatype.org/content/repositories/snapshots/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> adx
> Could not resolve javazoom:jlayer:1.0.1.
> Could not get resource 'https://repo.maven.apache.org/maven2/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> adx
> Could not resolve javazoom:jlayer:1.0.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> adx
> Could not resolve javazoom:jlayer:1.0.1.
> Could not get resource 'https://www.jitpack.io/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> Could not GET 'https://www.jitpack.io/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> adx
> Could not resolve javazoom:jlayer:1.0.1.
> Could not get resource 'https://repo.maven.apache.org/maven2/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> adx
> Could not resolve javazoom:jlayer:1.0.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> adx
> Could not resolve javazoom:jlayer:1.0.1.
> Could not get resource 'https://jitpack.io/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> Could not GET 'https://jitpack.io/javazoom/jlayer/1.0.1/jlayer-1.0.1.pom'.
> adx

  • 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.

  • Android

React Native Version

72.4

React Native Compressor Version

1.9.0

Reproducible Steps And Demo

Copy link

👋 @ahmedhango
Thanks for opening your issue here! If you find this package useful hit the star🌟!

@ahmedhango
Copy link
Author

android build .gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 29
compileSdkVersion = 34
targetSdkVersion = 34
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
playServicesLocationVersion = "21.0.1"
}

repositories {
    google()
    mavenCentral()
    maven { url 'https://jitpack.io' }
}
dependencies {
    classpath 'com.google.gms:google-services:4.4.1'
    classpath 'com.android.tools.build:gradle:7.4.2'
    classpath("com.facebook.react:react-native-gradle-plugin")



}

}
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace "com.nupconeer"
}
}
}
// Task to ensure namespace and remove package attribute
project.tasks.register("fixManifestsAndNamespace") {
doLast {
// Ensure namespace in build.gradle
def buildGradleFile = file("${project.projectDir}/build.gradle")
if (buildGradleFile.exists()) {
def buildGradleContent = buildGradleFile.getText('UTF-8')
def manifestFile = file("${project.projectDir}/src/main/AndroidManifest.xml")
if (manifestFile.exists()) {
def manifestContent = manifestFile.getText('UTF-8')
def packageName = manifestContent.find(/package="([^"]+)"/) { match, p -> p }
if (packageName && !buildGradleContent.contains("namespace")) {
println "Setting namespace in ${buildGradleFile}"
buildGradleContent = buildGradleContent.replaceFirst(
/android\s*{/, "android {\n namespace '${packageName}'"
)
buildGradleFile.write(buildGradleContent, 'UTF-8')
}
}
}

            // Remove package attribute from AndroidManifest.xml
            def manifests = fileTree(dir: project.projectDir, includes: ['**/AndroidManifest.xml'])
            manifests.each { File manifestFile ->
                def manifestContent = manifestFile.getText('UTF-8')
                if (manifestContent.contains('package=')) {
                    println "Removing package attribute from ${manifestFile}"
                    manifestContent = manifestContent.replaceAll(/package="[^"]*"/, '')
                    manifestFile.write(manifestContent, 'UTF-8')
                }
            }
        }
    }

    // Ensure the task runs before the build process
    project.tasks.matching { it.name.startsWith("preBuild") }.all {
        dependsOn project.tasks.named("fixManifestsAndNamespace")
    }
}

}

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

1 participant