thadhouse
06/05/2022, 10:30 PMtasks
? We have a bunch where we disable the static or shared binary instance by setting buildable to false, but the tasks still show up, and some users try to build them, which fails.thadhouse
06/13/2022, 8:33 PMMarcell Győrik
07/22/2022, 2:21 PMMartmists
07/25/2022, 2:26 AMlibrary {
toolChains {
configureEach { // I also tried `val devkitA64 by creating(Gcc::class)` but it complained it wasn't able to make it
if (this is Gcc) {
target("nx") {
platform.architecture("aarch64")
cppCompiler.executable = binary("aarch64-none-elf-g++")
cppCompiler.withArguments {
addAll(CPPFLAGS.split(' '))
}
assembler.executable = binary("aarch64-none-elf-as")
assembler.withArguments {
addAll(ASMFLAGS.split(' '))
}
linker.executable = binary("aarch64-none-elf-ld")
linker.withArguments {
addAll(CFLAGS.split(' '))
}
staticLibArchiver.executable = binary("aarch64-none-elf-ar")
}
}
}
}
Martmists
07/25/2022, 8:40 AMMarcell Győrik
07/29/2022, 10:50 AMEivind Naess
08/05/2022, 7:21 PMEivind Naess
08/05/2022, 7:23 PMKapilarny YT
08/31/2022, 12:21 AMKapilarny YT
08/31/2022, 1:15 PManita
09/21/2022, 9:14 PMBasil Mathew
09/27/2022, 6:03 PMthadhouse
11/03/2022, 6:38 AMJendrik Johannes
12/06/2022, 10:59 AMthadhouse
12/09/2022, 9:39 PMpriya
07/06/2023, 10:44 AMthadhouse
07/22/2023, 11:41 PMJan Jörke
08/25/2023, 10:03 AMpackage com.heidelberg.bld.gradle.legacy.cpp.dependency;
import java.io.File;
import org.gradle.api.Project;
import org.gradle.api.internal.CollectionCallbackActionDecorator;
import org.gradle.api.internal.file.DefaultFileCollectionFactory;
import org.gradle.nativeplatform.NativeLibraryBinary;
import org.gradle.nativeplatform.PrebuiltLibrary;
import org.gradle.nativeplatform.internal.DefaultFlavor;
import org.gradle.nativeplatform.internal.prebuilt.DefaultPrebuiltLibrary;
import org.gradle.nativeplatform.internal.prebuilt.DefaultPrebuiltSharedLibraryBinary;
import org.gradle.nativeplatform.internal.prebuilt.DefaultPrebuiltStaticLibraryBinary;
import com.heidelberg.bld.gradle.legacy.cpp.dependency.binary.Binary;
import com.heidelberg.bld.gradle.legacy.cpp.dependency.binary.SharedLibraryBinary;
import com.heidelberg.bld.gradle.legacy.cpp.dependency.binary.StaticLibraryBinary;
public class PrebuiltLibraryFactory {
private PrebuiltLibraryFactory() {
// hide constructor
}
public static PrebuiltLibrary createPrebuiltLibrary(Library library, Project project) {
DefaultPrebuiltLibrary prebuiltLibrary = new DefaultPrebuiltLibrary(library.getName(), project.getObjects(),
CollectionCallbackActionDecorator.NOOP);
for (Binary binary : library.getBinaries()) {
switch (binary.getBinaryType()) {
case SHARED_LIB:
prebuiltLibrary.getBinaries().add(newSharedLibrary(prebuiltLibrary, (SharedLibraryBinary) binary));
break;
case STATIC_LIB:
prebuiltLibrary.getBinaries().add(newStaticLibrary(prebuiltLibrary, (StaticLibraryBinary) binary));
break;
case EXECUTABLE:
default:
// do nothing
break;
}
}
for (File include : library.getIncludes()) {
prebuiltLibrary.getHeaders().srcDir(include);
}
return prebuiltLibrary;
}
private static NativeLibraryBinary newSharedLibrary(PrebuiltLibrary library, SharedLibraryBinary binary) {
DefaultPrebuiltSharedLibraryBinary shareLibraryBinary = new DefaultPrebuiltSharedLibraryBinary(
library.getName(), library, binary.getBuildType().toGradle(), binary.getPlatform().toGradle(),
new DefaultFlavor("default"), new DefaultFileCollectionFactory());
shareLibraryBinary.setSharedLibraryLinkFile(binary.getLinkFile());
if (binary.getFile().isPresent()) {
shareLibraryBinary.setSharedLibraryFile(binary.getFile().get());
}
return shareLibraryBinary;
}
private static NativeLibraryBinary newStaticLibrary(PrebuiltLibrary library, StaticLibraryBinary binary) {
DefaultPrebuiltStaticLibraryBinary staticLibraryBinary = new DefaultPrebuiltStaticLibraryBinary(
library.getName(), library, binary.getBuildType().toGradle(), binary.getPlatform().toGradle(),
new DefaultFlavor("default"), new DefaultFileCollectionFactory());
staticLibraryBinary.setStaticLibraryFile(binary.getFile());
return staticLibraryBinary;
}
}
David Frenzel
09/26/2023, 3:40 PMKanishk Dutt Sharma
10/18/2023, 8:51 AM[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();
}
}
thadhouse
11/07/2023, 5:28 AMJoshuA
12/08/2023, 2:27 PMJoshuA
12/08/2023, 2:28 PMANTIQUE
02/08/2024, 6:54 AMCould 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
daniel
02/08/2024, 2:59 PMWill Jackson
02/08/2024, 5:18 PMinstallTest
isn't picking up the dependency? Anyone seen anything like this?daniel
02/09/2024, 7:06 PMdev.nokee.cmake-build-adapter
). It shows a lot of potential but unfortunately is not the main focus at this point.daniel
02/09/2024, 7:10 PMinstall
task then ran on the command line? If that is the case did you use the generated script or directly the app executable? The install task should copy over the shared library to the install location (you can inspect to see if that was successful) and the script will configure the library path for a successful execution. Running directly the executable will require some manual setup first to ensure the library is found by the OS.Rob
02/28/2024, 7:18 PMandroid { 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.