https://gradle.com/ logo
Join Slack
Powered by
# native
  • k

    Kapilarny YT

    08/31/2022, 1:15 PM
    Nevermind got it working 😄
    👍 1
  • s

    Slackbot

    09/21/2022, 9:14 PM
    This message was deleted.
    d
    • 2
    • 1
  • s

    Slackbot

    09/27/2022, 6:03 PM
    This message was deleted.
    d
    b
    • 3
    • 15
  • s

    Slackbot

    11/03/2022, 6:38 AM
    This message was deleted.
    d
    • 2
    • 2
  • j

    Jendrik Johannes

    12/06/2022, 10:59 AM
    If anyone knows if there is a specific reason why certain tasks for native development in Gradle core (Assemble, LinkExecutable, CreateStaticLibrary) are not cacheable, I would be happy to hear about that. I created this PR: https://github.com/gradle/gradle/pull/22993
  • s

    Slackbot

    12/09/2022, 9:39 PM
    This message was deleted.
    d
    • 2
    • 1
  • s

    Slackbot

    07/06/2023, 10:44 AM
    This message was deleted.
    d
    • 2
    • 1
  • s

    Slackbot

    07/22/2023, 11:41 PM
    This message was deleted.
    d
    t
    • 3
    • 3
  • s

    Slackbot

    08/25/2023, 10:03 AM
    This message was deleted.
    d
    j
    • 3
    • 3
  • s

    Slackbot

    09/26/2023, 3:40 PM
    This message was deleted.
    d
    • 2
    • 2
  • k

    Kanishk Dutt Sharma

    10/18/2023, 8:51 AM
    Cause: couldn't make a guess for com.example.data_binding.myClickhandler this is the error i am getting when i try to create onclick action listnerer with help of data binding i have give the code below (edited)
    Copy code
    [2:18 PM] <?xml version="1.0" encoding="utf-8"?>
    <layout
        xmlns:android="<http://schemas.android.com/apk/res/android>"
        xmlns:app="<http://schemas.android.com/apk/res-auto>"
        xmlns:tools="<http://schemas.android.com/tools>"
        >
        <data>
            <variable
                name="Person"
                type="com.example.data_binding.Person" />
    
            <variable
                name="Clickhandler"
                type="com.example.data_binding.myClickhandler" />
        </data>
    
    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">
    
        <TextView
            android:id="@+id/textView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{Person.name}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
    
        <TextView
            android:id="@+id/textView2"
            android:layout_width="0dp"
            android:layout_height="16dp"
    
            android:text="@{Person.email}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.525"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/textView"
            app:layout_constraintVertical_bias="0.278">
    
        </TextView>
    
        <Button
            android:onClick="@{Clickhandler::onButton1Clicked}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/click_me"
            app:layout_constraintBottom_toTopOf="@+id/textView2"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.498"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/textView"
            app:layout_constraintVertical_bias="0.574">
    
        </Button>
    
    </androidx.constraintlayout.widget.ConstraintLayout>
    </layout>
    package com.example.data_binding;
    
    import android.os.Bundle;
    
    import androidx.appcompat.app.AppCompatActivity;
    import androidx.databinding.DataBindingUtil;
    
    import com.example.data_binding.databinding.ActivityMainBinding;
    
    public class MainActivity extends AppCompatActivity {
    
        private ActivityMainBinding activityMainBinding ;
        private myClickhandler myclickhandler;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            Person p1 = new Person("Jack" , "<mailto:jack2419@gmail.com|jack2419@gmail.com>");
            activityMainBinding = DataBindingUtil.setContentView(
                    this , R.layout.activity_main
            );
            activityMainBinding.setPerson(p1);
            myclickhandler = new myClickhandler(this);
            activityMainBinding.setClickhandler(myclickhandler);
        }
    }
    package com.example.data_binding;
    
    import android.content.Context;
    import android.view.View;
    import android.widget.Toast;
    
    public class myClickhandler {
    
        Context context;
    
        public myClickhandler(Context context) {
            this.context = context;
        }
    
        public void onButton1Clicked(View view) {
            Toast.makeText(context, "Button Clicked", Toast.LENGTH_SHORT).show();
        }
    }
  • s

    Slackbot

    11/07/2023, 5:28 AM
    This message was deleted.
    d
    t
    • 3
    • 3
  • j

    JoshuA

    12/08/2023, 2:27 PM
    hi
  • s

    Slackbot

    12/08/2023, 2:28 PM
    This message was deleted.
    d
    • 2
    • 1
  • a

    ANTIQUE

    02/08/2024, 6:54 AM
    PS D:\reactreact> cd today PS D:\reactreact\today> cd android PS D:\reactreact\today\android> ./gradlew cleanBuildCache FAILURE: Build completed with 3 failures. 1: Task failed with an exception. ----------- * Where: Settings file 'D:\reactreact\today\node_modules\@react-native\gradle-plugin\settings.gradle.kts' line: 16 * What went wrong: Error resolving plugin [id: 'org.gradle.toolchains.foojay-resolver-convention', version: '0.7.0']
    Could not resolve all dependencies for configuration 'detachedConfiguration1'.
    > Unexpected lock protocol found in lock file. Expected 3, found 0. * 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.
    ============================================================================== 2: Task failed with an exception. ----------- * What went wrong: Unexpected lock protocol found in lock file. Expected 3, found 0. * 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.
    ============================================================================== 3: Task failed with an exception. ----------- * What went wrong: Unexpected lock protocol found in lock file. Expected 3, found 0. * 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.
    ============================================================================== BUILD FAILED in 3s how i solve it run npx react-native run-android but this kind of error occurs plz help
  • d

    daniel

    02/08/2024, 2:59 PM
    It seems like the lock file is missing the dependency from adhoc configuration. It's more a Java/Android issue than native issue. It's confusing but the native in react-native is not the same native as this channel.
  • s

    Slackbot

    02/08/2024, 5:18 PM
    This message was deleted.
    w
    d
    • 3
    • 2
  • s

    Slackbot

    02/09/2024, 7:06 PM
    This message was deleted.
    w
    d
    • 3
    • 3
  • s

    Slackbot

    02/09/2024, 7:10 PM
    This message was deleted.
    w
    d
    • 3
    • 2
  • r

    Rob

    02/28/2024, 7:18 PM
    Hi all. I'm trying to compile a very, very simple set of JNI bindings (written in C++), for use in a JVM application, and it's been an absolute nightmare. Everything gradle+native seems under-documented and half finished. What I want to do is: 1. Compile src/main/cpp/libfoo-jni.cpp for Android using the ndk. This was super easy using
    android { externalNativeBuild {} }
    . 2. Compile src/main/cpp/libfoo-jni.cpp for windows (jvm) in the same way. Ideally using clang+cmake for consistency with Android. This has been a nightmare. So far I've tried: 1. Using nokee (jni-library, cpp-language). This gets me to the compilation step (hooray), but it's forcing use of MSVC, which is not compatible with my JNI bindings. I need to use clang or gcc. The docs say this is configurable, but not how to do so. The nokee sample projects are useless, because they're mainly demos of "look at how you don't need to configure anything!". 2. Using (com.cisco.external-build). I'm unable to get this working at all, because (1) all examples are in groovy, use magic, and are unclear how to port to kotlin, and (2) even using groovy, it seems like the plugin no longer works This whole process is making me feel stupid. I'm definitely a beginner at Gradle, but I've never run into difficulties of this magnitude with any other build system I've used (xcode, cmake, make etc..). Would I be better off trying to avoid using Gradle as much as possible for this and manually writing scripts to exec? I feel like this is the tool pushing back on me.
    t
    • 2
    • 1
  • b

    BenoĂŽt

    05/21/2024, 6:47 AM
    Hello! I've created an issue on Github at https://github.com/gradle/gradle/pull/29227 Gradle relies on a flag
    --show-sdk-platform-path
    for
    xcrun
    which as been removed at some point on some machine I suppose? It's rather difficult to find info about it online. The fix is to use the flag
    --show-sdk-path
    instead. I'm puzzled as to why I cannot find more of that error online. In any case, the only fix I have now is to run
    export SDKROOT=$(xcrun -sdk macosx --show-sdk-path)
    before running anything relying on
    MacOSSdkPlatformPathLocator
    for it not to break. I'm hoping this could get addressed within Gradle when possible.
    d
    • 2
    • 3
  • s

    SUSHANT SHETTY

    05/24/2024, 8:26 AM
    Hello I have created an issue on stackoverflow please anyone who can help regarding the following https://stackoverflow.com/questions/78526412/execution-failed-for-task-expo-modules-coreconfigurecmakedebugarm64-v8a
    d
    • 2
    • 1
  • p

    pavan kumar

    06/24/2024, 7:00 AM
    Hello everyone, I really need help with this problem I am facing. I am still new to gradle and am using ionic with gradle and am getting consistently the same error over and over again. I am running java 21.0.3 and kotlin 2.0.0 and gradle version 8.8. I really need help with this as soon as possible please.
    d
    • 2
    • 1
  • p

    pavan kumar

    06/24/2024, 7:01 AM
    Here is the error, [capacitor] ✖️ Running Gradle build - failed! [capacitor] [error] [capacitor] FAILURE: Build failed with an exception. [capacitor] [capacitor] * What went wrong: [capacitor] A problem occurred configuring root project 'android'. [capacitor] > Could not resolve all files for configuration ':classpath'. [capacitor] > Could not find com.android.tools.buildG8.8. [capacitor] Searched in the following locations: [capacitor] - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.8/gradle-8.8.pom [capacitor] - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/8.8/gradle-8.8.pom [capacitor] Required by: [capacitor] project : [capacitor] [capacitor] * Try: [capacitor] > Run with --stacktrace option to get the stack trace. [capacitor] > Run with --info or --debug option to get more log output. [capacitor] > Run with --scan to get full insights. [capacitor] > Get more help at https://help.gradle.org. [capacitor] [capacitor] BUILD FAILED in 798ms [capacitor] [ERROR] An error occurred while running subprocess capacitor. capacitor run android --target Pixel_3a_API_34 exited with exit code 1. Re-running this command with the --verbose flag may provide more information.
  • v

    Vinicius Silva

    07/10/2024, 12:08 AM
    Hey everyone, I am stuck with this error after upgrading expo in my project from 48 to 49 AILURE: Build failed with an exception.
    Copy code
    * What went wrong:
    Cannot locate tasks that match ':react-native-gradle-plugin:assemble' as project 'react-native-gradle-plugin' not found in root project
    d
    • 2
    • 2
  • h

    Harshit CWS

    09/03/2024, 3:54 AM
    Hi everyone, Can anyone help me to solve this error? Could not determine the dependencies of task 'react native google paybundleLibCompileToJarRelease'.
    Could not create task 'react native google paycompileReleaseJavaWithJavac'.
    > In order to compile Java 9+ source, please set compileSdkVersion to 30 or above In my android/build.gradle,i have: buildscript { ext { buildToolsVersion = "34.0.0" minSdkVersion = 23 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "26.1.10909125" kotlinVersion = "1.9.22" } repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.buildG8.2.1") // classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") } } apply plugin: "com.facebook.react.rootproject"
    d
    • 2
    • 1
  • t

    TamĂĄs Varjas

    09/13/2024, 10:49 AM
    Hi everyone! I'm trying to configure C++ compilation on arm64 architecture, while using the
    cpp-library
    plugin. (Note: I'm not talking about cross-compilation. I would like to compile for x86_64 on x86_64 and for arm64 on arm64). I managed to solve the same using the old
    cpp
    plugin like this (where
    arch
    is determined based on a property passed in with
    -P
    ):
    Copy code
    plugins {
        id 'cpp'
    }
    
    model {
        toolChains {
            gcc(Gcc) {
                target("linux_aarch64") {
                    cppCompiler.executable = '/usr/bin/gcc'
                }
            }
        }
    
        platforms {
            x86_64 {
                architecture 'x86_64'
            }
            linux_aarch64 {
                architecture 'arm64'
                operatingSystem 'linux'
            }
        }
    
        components {
            main(NativeLibrarySpec) {
                  targetPlatform arch
                
    			  <...>
            }
    	}
    }
    However, I've been unable to achieve the same using the
    cpp-library
    plugin or even when "mixing"
    cpp
    and
    cpp-library
    , like below:
    Copy code
    plugins {
        id 'cpp'
        id 'cpp-library'
    }
    
    model {
        toolChains {
            gcc(Gcc) {
                target("linux_aarch64") {
                    cppCompiler.executable = '/usr/bin/gcc'
                }
            }
        }
    
        platforms {
            x86_64 {
                architecture 'x86_64'
            }
            linux_aarch64 {
                architecture 'arm64'
                operatingSystem 'linux'
            }
        }
    }
    
    library {                     
        baseName = <...>
        linkage = [Linkage.SHARED]
    }                             
    
    tasks.withType(CppCompile).configureEach {
        targetPlatform arch
    
        <...>
    }
    All attempts involving the
    cpp-library
    plugin so far resulted in some variation of this error:
    Copy code
    > Failed to notify project evaluation listener.
       > No tool chain has support to build C++ for host operating system 'Linux' architecture 'aarch64':
           - Tool chain 'gcc' (GNU GCC):
               - Don't know how to build for host operating system 'Linux' architecture 'aarch64'.
    Can you point me in the direction for how to solve this? Or should I just forget about
    cpp-library
    as it is simply not doable?
  • t

    TheGoesen

    12/19/2024, 6:16 PM
    Hi, I am playing around with publishing. I got it working mostly somewhat working, but publishing fails for a project which is using the cpp-application plugin (generating the metadata suceeds). I think this is because on linux executables dont have an extension, but the maven repository format absolutely requires an extension... Is there a workaround for this?
    • 1
    • 1
  • d

    Daniele Puccio

    03/25/2025, 8:20 PM
    👋 Hello, team! Nice Meeting you all!
  • v

    Vin

    04/03/2025, 12:45 PM
    Help Build file 'H:\jacobtimer\build.gradle.kts' line: 10 Plugin [id: 'gg.essential.loom', version: '0.10.0.+', artifact: 'gg.essentialarchitectury loom0.10.0.+'] was not found in any of the following sources: * 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.