react-native-notifications icon indicating copy to clipboard operation
react-native-notifications copied to clipboard

Android Compile Error

Open jihokim2 opened this issue 6 years ago • 40 comments

I met android compile error. react-native: 0.63.2 react-native-notifications: 3.3.0

Log is like this. react-native-notifications: 3.2.2 works good.

1: Task failed with an exception.

  • Where: Build file '/node_modules/react-native-notifications/lib/android/app/build.gradle' line: 4

  • What went wrong: A problem occurred evaluating project ':react-native-notifications'.

Plugin with id 'kotlin-android' not found.

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

2: Task failed with an exception.

  • What went wrong: A problem occurred configuring project ':react-native-notifications'.

compileSdkVersion is not specified. Please add it to build.gradle

  • 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

jihokim2 avatar Jul 24 '20 05:07 jihokim2

Based on a suggestion for another library producing a similar error, I have applied the following changes. They seem to work. The following code demonstrates ONLY the changes. I am NOT suggesting deleting the rest of the code in the file. File: android/build.gradle

buildscript {
	ext {
		minSdkVersion = 21 // change this one from 16 to 21 
		// kotlinVersion = "1.3.72" // add this line (July 2020)
		kotlinVersion = "1.6.0" // add this line (Nov 2021)
	}

	dependencies {
		classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" // add this line 
	}
}

Bilal-Abdeen avatar Jul 29 '20 02:07 Bilal-Abdeen

It do not work. The problem: Received close_notify during handshake

chenweigh avatar Aug 06 '20 08:08 chenweigh

Same issue for me... RN 0.63.2, react-native-notifications 3.3.2

Charlicus avatar Aug 07 '20 15:08 Charlicus

Same issue for me.

RN 0.63.2 react-native-notifications 3.3.2

aleluis777 avatar Aug 10 '20 09:08 aleluis777

Same issue for me

RN 0.63.2 React native notifications 3.3.2

Cchumi avatar Aug 11 '20 09:08 Cchumi

Based on a suggestion for another library producing a similar error, I have applied the following changes. They seem to work. The following code demonstrates ONLY the changes. I am NOT suggesting deleting the rest of the code in the file. File: android/build.gradle

buildscript {
	ext {
		minSdkVersion = 21 // change this one from 16 to 21 
		kotlinVersion = "1.3.72" // add this line 
	}

	dependencies {
		classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" // add this line 
	}
}

Dropping Android 4 support is no solution for us.

Why was this changed in a recent release? Does the library require this now? The docs do not include any information and there are no changelogs.

comvenger-brandon avatar Aug 13 '20 08:08 comvenger-brandon

Same issue for me

RN 0.63.2 React native notifications 3.3.2

Alaa-Ben avatar Aug 19 '20 09:08 Alaa-Ben

Same for me. RN 0.62.2 React native notifications 3.3.2

huy-thp avatar Aug 22 '20 17:08 huy-thp

Same for me. RN 0.62.2 React native notifications 3.3.2

AndreasGS avatar Aug 27 '20 08:08 AndreasGS

Same for me. RN 0.63.2 React native notifications 3.3.2

amirulasrof avatar Aug 27 '20 08:08 amirulasrof

Same for me. RN 0.63.2 React native notifications 3.3.2

kurovskyiii avatar Aug 27 '20 12:08 kurovskyiii

Same for me RN 0.63.2 React native notifications 3.3.2

Issue:

ERROR: Plugin with id 'kotlin-android' not found.

louisiscoding avatar Aug 27 '20 19:08 louisiscoding

+1

janoist1 avatar Aug 31 '20 13:08 janoist1

The solution proposed by @Bilal-Abdeen works but the app crash on startup. It now compile properly though.

bitsmanent avatar Sep 03 '20 10:09 bitsmanent

@clamiax Try the following

  1. cd <proj_folder>/android
  2. gradlew clean
  3. cd ..
  4. npx react-native run-android

Bilal-Abdeen avatar Sep 03 '20 22:09 Bilal-Abdeen

@Bilal-Abdeen I already tried but with no luck. The app keep crashing on startup.

EDIT: I currently "solved" with react-native-push-notification.

bitsmanent avatar Sep 04 '20 11:09 bitsmanent

+1

riordanpawley avatar Sep 11 '20 04:09 riordanpawley

Same for me. RN 0.63.2 React native notifications 3.3.2

SavageWilliam avatar Sep 14 '20 11:09 SavageWilliam

The same issue +1.

RN 0.63.2 React native notifications 3.3.2

arlovip avatar Sep 15 '20 08:09 arlovip

Same for me

HDDRT avatar Sep 17 '20 09:09 HDDRT