输出aar 到新项目,运行成功
This commit is contained in:
+8
-10
@@ -9,12 +9,11 @@ apply from: "./download_vvl.gradle"
|
||||
|
||||
android {
|
||||
namespace 'com.hmwl.sample'
|
||||
compileSdk 35
|
||||
|
||||
compileSdk 36
|
||||
defaultConfig {
|
||||
// applicationId "com.hmwl.sample"
|
||||
minSdk 30
|
||||
targetSdk 35
|
||||
targetSdk 36
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
@@ -57,17 +56,16 @@ android {
|
||||
}
|
||||
|
||||
|
||||
// 添加解压的 AAR 资源
|
||||
sourceSets {
|
||||
main {
|
||||
jniLibs.srcDirs += [
|
||||
'libs/tasks-vision/jni',
|
||||
'libs/tasks-core/jni'
|
||||
]
|
||||
java.srcDirs += [
|
||||
'libs/tasks-vision/classes',
|
||||
'libs/tasks-core/classes'
|
||||
]
|
||||
// java.srcDirs += [
|
||||
// 'libs/tasks-vision/vision_classes',
|
||||
// 'libs/tasks-core/core_classes'
|
||||
// ]
|
||||
res.srcDirs += [
|
||||
'libs/tasks-vision/res',
|
||||
'libs/tasks-core/res'
|
||||
@@ -95,8 +93,8 @@ dependencies {
|
||||
// implementation files('libs/tasks-vision-0.10.26.aar')
|
||||
// implementation files('libs/tasks-core-0.10.26.aar')
|
||||
|
||||
implementation fileTree(dir: 'libs/tasks-vision', include: ['*.jar'])
|
||||
implementation fileTree(dir: 'libs/tasks-core', include: ['*.jar'])
|
||||
implementation 'com.google.protobuf:protobuf-javalite:3.21.12'
|
||||
implementation files('libs/tasks-vision.jar', 'libs/tasks-core.jar')
|
||||
|
||||
|
||||
def camerax_version = '1.4.2'
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
<!-- 声明 MainActivity -->
|
||||
<!-- 作为库,exported 通常设为 false,除非明确需要外部应用启动 -->
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="false"
|
||||
android:name=".FaceActivity"
|
||||
android:exported="true"
|
||||
tools:ignore="MissingClass"> <!-- 如果IDE报类找不到,可以添加这个 -->
|
||||
|
||||
<!-- 重要:移除 MAIN/LAUNCHER intent-filter -->
|
||||
|
||||
@@ -308,4 +308,8 @@ public class FaceActivity extends GameActivity implements FaceLandmarkerHelper.L
|
||||
}
|
||||
|
||||
public native void passDataToNative(ByteBuffer buffer, int pointCount, int width, int height);
|
||||
|
||||
protected void ChangeState(String json){
|
||||
Log.i("FaceActivity", "ChangeState:" + json);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Sample" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
@@ -1,16 +0,0 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Sample" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user