fix: 修改首次安装时,因为定位初始化问题程序崩溃的问题
This commit is contained in:
parent
f385fb8e6c
commit
480ff37026
@ -37,8 +37,8 @@ android {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 30
|
||||
versionCode 116
|
||||
versionName "8.230926-正式版"
|
||||
versionCode 117
|
||||
versionName "8.231011-金山云测试版"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
ndk {
|
||||
|
@ -142,35 +142,35 @@ public class MainActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onGranted(List<String> permissions, boolean all) {
|
||||
if (all) {
|
||||
LogConfiguration logConfiguration = new LogConfiguration.Builder()
|
||||
// .enableStackTrace(5)
|
||||
// .enableBorder()
|
||||
.tag("XLog").build();
|
||||
Printer androidPrinter = new AndroidPrinter(true); // 通过 android.util.Log 打印日志的打印器
|
||||
Printer consolePrinter = new ConsolePrinter(); // 通过 System.out 打印日志到控制台的打印器
|
||||
Printer filePrinter = new FilePrinter // 打印日志到文件的打印器
|
||||
.Builder(Constant.LOG_FOLDER) // 指定保存日志文件的路径
|
||||
.fileNameGenerator(new LevelFileNameGenerator()) // 指定日志文件名生成器,默认为 ChangelessFileNameGenerator("log")
|
||||
.flattener(new ClassicFlattener())
|
||||
.build();
|
||||
// 初始化XLog
|
||||
XLog.init( // 初始化 XLog
|
||||
logConfiguration, // 指定日志配置,如果不指定,会默认使用 new LogConfiguration.Builder().build()
|
||||
androidPrinter, // 添加任意多的打印器。如果没有添加任何打印器,会默认使用 AndroidPrinter(Android)/ConsolePrinter(java)
|
||||
consolePrinter,
|
||||
filePrinter);
|
||||
|
||||
// 尝试定位
|
||||
LocationLifeCycle.getInstance().init(getApplicationContext());
|
||||
// 开始获取腾讯定位信息
|
||||
LocationLifeCycle.getInstance().startTencentLocation();
|
||||
|
||||
if (Constant.USHERED != null) {
|
||||
HttpInterface.initAppPath(Constant.USHERED);
|
||||
Constant.initRootFolder(Constant.USHERED);
|
||||
HttpInterface.initHttpInter(Constant.USHERED);
|
||||
// 检查版本
|
||||
initCheckVersion();
|
||||
|
||||
LogConfiguration logConfiguration = new LogConfiguration.Builder()
|
||||
// .enableStackTrace(5)
|
||||
// .enableBorder()
|
||||
.tag("XLog").build();
|
||||
Printer androidPrinter = new AndroidPrinter(true); // 通过 android.util.Log 打印日志的打印器
|
||||
Printer consolePrinter = new ConsolePrinter(); // 通过 System.out 打印日志到控制台的打印器
|
||||
Printer filePrinter = new FilePrinter // 打印日志到文件的打印器
|
||||
.Builder(Constant.LOG_FOLDER) // 指定保存日志文件的路径
|
||||
.fileNameGenerator(new LevelFileNameGenerator()) // 指定日志文件名生成器,默认为 ChangelessFileNameGenerator("log")
|
||||
.flattener(new ClassicFlattener())
|
||||
.build();
|
||||
// 初始化XLog
|
||||
XLog.init( // 初始化 XLog
|
||||
logConfiguration, // 指定日志配置,如果不指定,会默认使用 new LogConfiguration.Builder().build()
|
||||
androidPrinter, // 添加任意多的打印器。如果没有添加任何打印器,会默认使用 AndroidPrinter(Android)/ConsolePrinter(java)
|
||||
consolePrinter,
|
||||
filePrinter);
|
||||
|
||||
// 尝试定位
|
||||
LocationLifeCycle.getInstance().init(getApplicationContext());
|
||||
// 开始获取腾讯定位信息
|
||||
LocationLifeCycle.getInstance().startTencentLocation();
|
||||
} else {
|
||||
initTime();
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ public class HttpInterface {
|
||||
// public static final String IP = "http://172.23.138.133:9999/m4";//测试接口-IP
|
||||
// public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/dev/m4";//开发接口-外网
|
||||
|
||||
// public static final String IP = "http://120.92.15.187/dtxb/test/m4";//开发接口-外网
|
||||
// public static final String IP_UPLOAD = "http://120.92.109.239/dtxb/test/m4";//开发接口-外网
|
||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/m4";//金山云接口地址
|
||||
public static final String IP_UPLOAD = "http://dtxbmaps.navinfo.com/dtxb/m4";//金山云接口地址-数据上传
|
||||
// public static final String IP = "http://120.92.212.218/dtxb/test/m4";//金山云接口地址
|
||||
// public static final String IP_UPLOAD = "http://120.131.12.158/dtxb/test/m4";//金山云接口地址-数据上传
|
||||
public static final String IP = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//正式环境接口
|
||||
public static final String IP_UPLOAD = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//正式环境接口
|
||||
public static final String IP1 = "http://dtxbmaps.navinfo.com/dtxb/test/m4";//测试接口-外网
|
||||
public static final String IP2 = "http://dtxbmaps.navinfo.com/dtxb/m4";//正式接口
|
||||
public static final String IP4 = "http://10.130.23.166/dtxb/jinshan/m4";//心榕给的测试地址
|
||||
|
Loading…
x
Reference in New Issue
Block a user