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

Android: Error in nativescript-cfalert-dialog include.js when running nativescript android app #42

Open
rickystern opened this issue Mar 8, 2023 · 2 comments

Comments

@rickystern
Copy link

Which platform(s) does your issue occur on?

  • Android
  • Android : 8.4.0
  • emulator

Please, provide the following version numbers that your issue occurs with:

  • CLI: 8.4.0

Please, tell us how to recreate the issue in as much detail as possible.

trying to run nativescript android project produces the following error:

Script 'appFolder/node_modules/nativescript-cfalert-dialog/platforms/android/include.gradle' line: 17
A problem occurred evaluating script.
Could not find method compile() for arguments [com.android.support:appcompat-v7:22.2.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Command ./gradlew failed with exit code 1

Can anyone assist in fixing this issue

@cristiandaulisio
Copy link

Hi! 👋

Today I used patch-package to patch [email protected] for the project I'm working on.

Changed to work on ns8.4 on Android

Here is the diff that solved my problem:

diff --git a/node_modules/nativescript-cfalert-dialog/cfalert-dialog.android.js b/node_modules/nativescript-cfalert-dialog/cfalert-dialog.android.js
index d78177a..c977c12 100644
--- a/node_modules/nativescript-cfalert-dialog/cfalert-dialog.android.js
+++ b/node_modules/nativescript-cfalert-dialog/cfalert-dialog.android.js
@@ -1,6 +1,6 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
-var app = require("@nativescript/application");
+var app = require("@nativescript/core/application");
 var color_1 = require("@nativescript/core");
 var CFAlertStyle;
 (function (CFAlertStyle) {
diff --git a/node_modules/nativescript-cfalert-dialog/platforms/android/include.gradle b/node_modules/nativescript-cfalert-dialog/platforms/android/include.gradle
index 7452280..ec7777e 100644
--- a/node_modules/nativescript-cfalert-dialog/platforms/android/include.gradle
+++ b/node_modules/nativescript-cfalert-dialog/platforms/android/include.gradle
@@ -14,7 +14,7 @@ dependencies {
   if(project.hasProperty("supportVersion")) {
   	supportVer = supportVersion
   }
-  compile "com.android.support:appcompat-v7:$supportVer"
-  compile "com.android.support:cardview-v7:$supportVer"
+  implementation "com.android.support:appcompat-v7:$supportVer"
+  implementation "com.android.support:cardview-v7:$supportVer"
   implementation group: 'com.crowdfire.cfalertdialog', name: 'cfalertdialog', version: '1.1.0'
 }

@shiv19
Copy link
Owner

shiv19 commented Mar 21, 2023

@cristiandaulisio Nice work! can you please PR that change, I can merge it and roll out a new version.
Just @ mention me so that I get an email about it. Thanks :)

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