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

[BUG] Package wouldn't let app compile in Gradle 7x #181

Open
Amitb01FUB opened this issue Sep 15, 2022 · 2 comments
Open

[BUG] Package wouldn't let app compile in Gradle 7x #181

Amitb01FUB opened this issue Sep 15, 2022 · 2 comments

Comments

@Amitb01FUB
Copy link

Amitb01FUB commented Sep 15, 2022

Found a fix for that particular problem, as said by @wcosmas in #175 maven was remove in Gradle 7.
This whole repo won't compile in Gradle 7, to fix that, you need to make some changes to the buid.gradle file inside the module folder (node_modules\react-native-alarm-notification\android\build.gradle)

line 23: apply plugin: 'maven-publish'

line 43: apply plugin: 'maven-publish'

line 112 replace the whole task block:

task androidJavadoc(type: Javadoc) {
        project.configurations.getByName("implementation").setCanBeResolved(true)
        source = android.sourceSets.main.java.srcDirs
        classpath += files(android.bootClasspath)
        classpath += files(project.getConfigurations().getByName('implementation').asList())
        include '**/*.java'
    }

line 145 comment/remove the whole task block:

// task installArchives(type: Upload) {
//     configuration = configurations.archives
//     repositories.mavenDeployer {
//         // Deploy to react-native-event-bridge/maven, ready to publish to npm
//         repository url: "file://${projectDir}/../android/maven"
//         configureReactNativePom pom
//     }
// }

(honestly anything past line 108 is probably not needed for this to run but I didn't check)

after that the app will build with Gradle >=7

Originally posted by @Amitb01FUB in #175 (comment)

@Amitb01FUB Amitb01FUB changed the title Package wouldn't let app compile in Gradle 7x [BUG] Package wouldn't let app compile in Gradle 7x Sep 15, 2022
@eggn
Copy link

eggn commented Oct 14, 2022

Same here.

build.gradle
...
dependencies {
classpath("com.android.tools.build:gradle:7.2.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
}

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

"react": "18.1.0",
"react-native": "0.70.0",

ghashi added a commit to ghashi/react-native-alarm-notification that referenced this issue Nov 5, 2022
ghashi added a commit to ghashi/react-native-alarm-notification that referenced this issue Nov 5, 2022
ghashi added a commit to ghashi/react-native-alarm-notification that referenced this issue Nov 5, 2022
ghashi added a commit to ghashi/react-native-alarm-notification that referenced this issue Nov 5, 2022
ghashi added a commit to ghashi/react-native-alarm-notification that referenced this issue Nov 5, 2022
@jorgerojas26
Copy link

This solved my problem. Thank you.

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

3 participants