Android Notes

maven 版本发布

1、小于 AGP7+

使用 maven 插件

groovy 复制代码
apply plugin: 'maven'
uploadArchives {
    repositories {
        mavenDeployer {
            pom.groupId = GROUP_ID
            pom.artifactId = ARTIFACT_ID
            pom.version = VERSION
            //正式版本
            repository(url: RELEASE_URL) {
    			authentication(userName: userName, password: pwd)
			}
			//快照版本
			snapshotRepository(url: SNAPSHOT_URL) {
			    authentication(userName: userName, password: pwd)
			}
        }
    }
}

2、大于等于 AGP7+

Goodle Android

使用 maven-publish 插件

groovy 复制代码
plugins {
    id 'maven-publish'
}


afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                from components.release
                groupId = GROUP_ID
                artifactId = ARTIFACT_ID
                version = "$sample_version"
            }
        }

        repositories {
            maven {
            	//如果仓库地址是 http,https 则不需要
                allowInsecureProtocol true
                url 'http://****/repository/primer-snapshot'
                credentials {
                    username "123456"
                    password "123456"
                }
            }
        }
    }
}

More than one file was found with OS

问题

groovy 复制代码
Execution failed for task ':app:mergeCommonReleaseNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'lib/x86/liblog.so'.
If you are using jniLibs and CMake IMPORTED targets,
see https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake

解决

groovy 复制代码
 defaultConfig {
    packagingOptions {
        exclude 'lib/x86_64/liblog.so'
        exclude 'lib/x86/liblog.so'
        exclude 'lib/arm64-v8a/liblog.so'
        exclude 'lib/armeabi-v7a/liblog.so'
    }
}

导出设备安装包

实现比较简单,前提是已安装 adb ,利用 adb pm、adb pull 命令可以实现

js 复制代码
@echo
echo Please wait while the script is executing ... ... 

for /f "tokens=2 delims=:" %%a in ('adb shell pm list packages') do (
	for /f "tokens=2 delims=:" %%p in ('adb shell pm path %%a') do (
		adb pull %%p . > null
	)
)

echo The execution is complete.
pause
相关推荐
流星雨在线2 分钟前
安卓使用 Startup 管理三方 SDK 初始化
android·startup
jwn9993 分钟前
Laravel3.x:PHP框架的经典里程碑
android
lishutong10066 分钟前
基于 Perfetto 与 AI 的 Android 性能自动化诊断方案
android·人工智能·自动化
REDcker7 分钟前
Android Bionic Libc 原理与实现综述
android·c++·c·ndk·native·bionic
葱段11 分钟前
Flutter 设置Android System Navigation/Status Bar背景色
android·flutter
半条-咸鱼30 分钟前
如何通过 ADB 连接安卓设备(USB + 无线 TCP/IP)
android·adb
vonlycn35 分钟前
Android Studio 5.3.3 新项目编译报错解决
android·ide·android studio
fengci.38 分钟前
php反序列化(复习)(第二章)
android·开发语言·学习·php
sickworm陈浩44 分钟前
为 300W 行的安卓老工程落地可迭代的 AI 知识库
android·ai编程
jwn9991 小时前
Laravel 9.x重磅新特性解析
android