-
Notifications
You must be signed in to change notification settings - Fork 5
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 port #461
Comments
With version 3.4.2 we now have an Android variant: https://repo1.maven.org/maven2/de/larsgrefer/sass/sass-embedded-android/3.4.2/ There is also an example app which uses the new library: https://github.com/larsgrefer/dart-sass-java/blob/3.x/test-projects/android-app/src/main/java/de/larsgrefer/sass/embedded/android/test/MainActivity.java |
Thank you, can the previous methods be used? |
now testing and result 02-19 11:30:19.377 985 985 E lib : No dart binary found for ABIs [arm64-v8a, armeabi-v7a, armeabi] |
Have you used this setting in your apps build.gradle?
|
yes adding and not work compile to system android can you make apk demo file? |
Just clone this repo and run |
hi @larsgrefer im winter code to compile scss package Ninja.coder.Ghostemane.code.tasks.app;
import Ninja.coder.Ghostemane.code.ColorAndroid12;
import android.content.Context;
import android.widget.EditText;
import android.widget.LinearLayout;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.android.material.color.MaterialColors;
import com.sass_lang.embedded_protocol.InboundMessage;
import de.larsgrefer.sass.embedded.CompileSuccess;
import de.larsgrefer.sass.embedded.SassCompiler;
import de.larsgrefer.sass.embedded.connection.CompilerConnection;
import de.larsgrefer.sass.embedded.connection.Packet;
import java.io.File;
import java.io.IOException;
public class SassForAndroid {
protected static SassCompiler compiler;
static {
compiler =
new SassCompiler(
new CompilerConnection() {
@Override
public void sendMessage(Packet<InboundMessage> arg0) {}
@Override
public void sendMessage(int arg0, InboundMessage arg1) {}
@Override
public Packet<com.sass_lang.embedded_protocol.OutboundMessage> readResponse() {
return null;
}
@Override
public void close() {}
});
}
public static String CompileForStringScss(String input) {
try {
CompileSuccess sb = compiler.compileScssString(input);
return sb.getCss();
} catch (Exception err) {
return err.getLocalizedMessage();
}
}
public static void CompilerForFile(File input, String output) {
try {
CompileSuccess sb = compiler.compileFile(input);
output = sb.getCss();
} catch (Exception err) {
err.printStackTrace();
}
}
public static void CompileForStringSass(String input, String output) {
try {
CompileSuccess sb = compiler.compileSassString(input);
output = sb.getCss();
} catch (Exception err) {
err.printStackTrace();
}
}
public static void run(Context context, String input) {
var sheet = new BottomSheetDialog(context);
EditText tv = new EditText(context);
LinearLayout.LayoutParams param =
new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
tv.setLayoutParams(param);
param.rightMargin = 3;
param.leftMargin = 3;
tv.setTextColor(MaterialColors.getColor(tv, ColorAndroid12.colorOnSurface, 0));
tv.setPadding(9, 9, 9, 9);
sheet.setContentView(tv);
tv.setText(CompileForStringScss(input));
sheet.show();
}
} result Attempt to invoke virtual method 'int de.larsgrefer.sass.embedded.connection.Packet.getCompilationId()' on a null object reference plz help me to fix |
and convert api 26 to 21 |
When you replace the This should be everything you need: Lines 31 to 36 in 5361ff6
|
@larsgrefer tnks fixed view in view code bro can you convert api 26 to 21? |
Task :app:processReleaseMainManifest FAILED See https://developer.android.com/r/studio-ui/build/manifest-merger for more information about the manifest merger. @larsgrefer plz fix |
@appt2 You have to update to 3.6.0. You are still using 3.5.1 which still has a minSdk of 26 |
last version mevan 3.5.1 |
Well, the Android version has been ported, so I will close this issue |
hello @larsgrefer can you adding android port?
The text was updated successfully, but these errors were encountered: