首页 \ 问答 \ 三星multiscreen Proguard与exoplayer冲突(samsung multiscreen Proguard conflict with exoplayer)

三星multiscreen Proguard与exoplayer冲突(samsung multiscreen Proguard conflict with exoplayer)

我想释放我的应用程序,但在proguard步骤中,我面临一个问题。 当我添加lobmok时生成一些警告(或者当我添加samsung-multiscreen jar文件时更具体)如下:

警告:com.google.android.exoplayer.MediaCodecAudioTrackRenderer:找不到引用的类android.media.PlaybackParams警告:com.google.android.exoplayer.audio.AudioTrack:找不到引用类android.media.PlaybackParams警告: com.google.android.exoplayer.audio.AudioTrack $ AudioTrackUtil:找不到引用类android.media.PlaybackParams警告:com.google.android.exoplayer.audio.AudioTrack $ AudioTrackUtilV23:找不到引用类android.media .PlaybackParams警告:com.google.android.exoplayer.audio.AudioTrack $ AudioTrackUtilV23:在库类android.media.AudioTrack中找不到引用的方法'void setPlaybackParams(android.media.PlaybackParams)'警告:com.google.android .exoplayer.audio.AudioTrack $ AudioTrackUtilV23:找不到引用的类android.media.PlaybackParams警告:com.google.android.exoplayer.chunk.VideoFormatSelectorUtil:找不到引用的方法'android.view.Display $ Mode getMode( )'在图书馆类android.view.Display Warni ng:com.google.android.exoplayer.chunk.VideoFormatSelectorUtil:找不到引用的类android.view.Display $ Mode

当我向proguard-rules.pro添加以下行时,其中一些消失了,但当我启动应用程序时它崩溃了。

-dontwarn lombok.**

另请试试这个:

-keep class com.google.android.exoplayer.** { *; }

我认为这是由于在外行人和多屏幕 (龙目岛)

有谁知道如何解决这个问题?


I want to release my app but in proguard step I face a problem. it Generate some warning when I add lobmok ( or be more specific when I add samsung-multiscreen jar file) as follows :

Warning:com.google.android.exoplayer.MediaCodecAudioTrackRenderer: can't find referenced class android.media.PlaybackParams Warning:com.google.android.exoplayer.audio.AudioTrack: can't find referenced class android.media.PlaybackParams Warning:com.google.android.exoplayer.audio.AudioTrack$AudioTrackUtil: can't find referenced class android.media.PlaybackParams Warning:com.google.android.exoplayer.audio.AudioTrack$AudioTrackUtilV23: can't find referenced class android.media.PlaybackParams Warning:com.google.android.exoplayer.audio.AudioTrack$AudioTrackUtilV23: can't find referenced method 'void setPlaybackParams(android.media.PlaybackParams)' in library class android.media.AudioTrack Warning:com.google.android.exoplayer.audio.AudioTrack$AudioTrackUtilV23: can't find referenced class android.media.PlaybackParams Warning:com.google.android.exoplayer.chunk.VideoFormatSelectorUtil: can't find referenced method 'android.view.Display$Mode getMode()' in library class android.view.Display Warning:com.google.android.exoplayer.chunk.VideoFormatSelectorUtil: can't find referenced class android.view.Display$Mode

When I add following line to proguard-rules.pro some of the them disappeared but When I launch to the application it crash.

-dontwarn lombok.**

Also try this :

-keep class com.google.android.exoplayer.** { *; }

I think it raise due to conflict between annotation used in exoplayer and multiscreen (lombok)

does anyone knows how to fix this issue ?


原文:https://stackoverflow.com/questions/34825289
更新时间:2023-04-02 13:04

最满意答案

将您的northings / eastings转换为lat / long,记住OS网格基于OSGB36而不是WGS84。

我使用以下类:

<?php

namespace OSGB36;

use \Geodetic\Datum;

class Converter
{
    private $_osRef;
    private $_fromDatum;
    private $_toDatum;

    public function __construct()
    {
        $this->_osRef = new OSRef();
        $this->_fromDatum = new Datum(Datum::OSGB36);
        $this->_toDatum = new Datum(Datum::WGS84);
    }

    /**
     * Converts easting/northing into lat/long
     * 
     * @param integer $eastings
     * @param integer $northings
     * @return \Geodetic\LatLong
     */
    public function calculateLatLong($eastings, $northings)
    {
        $this->_osRef->setNorthings($northings)
                     ->setEastings($eastings);
        $OSGB36LatLong = $this->_osRef->toLatLong(
            $this->_fromDatum->getReferenceEllipsoid()
        );

        $ecef = $OSGB36LatLong->toECEF($this->_fromDatum);
        $ecef->toWGS84($this->_fromDatum);
        $WGS84LatLong = $ecef->toLatLong($this->_toDatum);

        return $WGS84LatLong;
    }
}

<?php

namespace OSGB36;

use \Geodetic\LatLong\CoordinateValues;

class OSRef
{
    private $_northings;
    private $_eastings;

    public function __construct($northings = NULL, $eastings = NULL)
    {
        $this->_northings = $northings;
        $this->_eastings  = $eastings;
    }

    public function setNorthings($northings)
    {
        $this->_northings = $northings;

        return $this;
    }

    public function setEastings($eastings)
    {
        $this->_eastings = $eastings;

        return $this;
    }


    private function _sinSquared($x) {
        return sin($x) * sin($x);
    }

    private function _tanSquared($x) {
        return tan($x) * tan($x);
    }

    private function _secant($x) {
        return 1.0 / cos($x);
    }

    private function _cosecant($x) {
        return 1.0 / sin($x);
    }

    private function _cotangent($x) {
        return 1.0 / tan($x);
    }

    public function toLatLong(\Geodetic\ReferenceEllipsoid $airy1830) {
        $OSGB_F0       = 0.9996012717;    //  Central Meridan Scale factor
        $N0            = -100000.0;       //  True origin Northing
        $E0            = 400000.0;        //  True origin Easting
        $phi0          = deg2rad(49.0);   //  True origin Latitude
        $lambda0       = deg2rad(-2.0);   //  True origin Longitude
        $semiMajorAxis = $airy1830->getSemiMajorAxis();
        $semiMinorAxis = $airy1830->getSemiMinorAxis();
        $eSquared      = $airy1830->getFirstEccentricitySquared();
        $easting       = $this->_eastings - $E0;
        $northing      = $this->_northings - $N0;
        $n             = ($semiMajorAxis - $semiMinorAxis) / ($semiMajorAxis + $semiMinorAxis);
        $M             = 0.0;
        $phiPrime      = ($northing / ($semiMajorAxis * $OSGB_F0)) + $phi0;

        do {
            $M = ($semiMinorAxis * $OSGB_F0) *
                (((1 + $n + ((5.0 / 4.0) * $n * $n) + ((5.0 / 4.0) * $n * $n * $n)) *
                ($phiPrime - $phi0)) -
                (((3 * $n) + (3 * $n * $n) + ((21.0 / 8.0) * $n * $n * $n)) *
                sin($phiPrime - $phi0) *
                cos($phiPrime + $phi0)) +
                ((((15.0 / 8.0) * $n * $n) + ((15.0 / 8.0) * $n * $n * $n)) *
                sin(2.0 * ($phiPrime - $phi0)) *
                cos(2.0 * ($phiPrime + $phi0))) -
                (((35.0 / 24.0) * $n * $n * $n) *
                sin(3.0 * ($phiPrime - $phi0)) *
                cos(3.0 * ($phiPrime + $phi0))));
            $phiPrime += ($northing - $M) / ($semiMajorAxis * $OSGB_F0);
        } while (($northing - $M) >= 0.001);

        $v = $semiMajorAxis * $OSGB_F0 * pow(1.0 - $eSquared * $this->_sinSquared($phiPrime), -0.5);
        $rho = $semiMajorAxis * $OSGB_F0 * (1.0 - $eSquared) *
            pow(1.0 - $eSquared * $this->_sinSquared($phiPrime), -1.5);
        $etaSquared = ($v / $rho) - 1.0;
        $VII = tan($phiPrime) / (2 * $rho * $v);
        $VIII = (tan($phiPrime) / (24.0 * $rho * pow($v, 3.0))) *
            (5.0 + (3.0 * $this->_tanSquared($phiPrime)) + $etaSquared - (9.0 * $this->_tanSquared($phiPrime) * $etaSquared));
        $IX = (tan($phiPrime) / (720.0 * $rho * pow($v, 5.0))) *
            (61.0 + (90.0 * $this->_tanSquared($phiPrime)) + (45.0 * $this->_tanSquared($phiPrime) * $this->_tanSquared($phiPrime)));
        $X = $this->_secant($phiPrime) / $v;
        $XI = ($this->_secant($phiPrime) / (6.0 * $v * $v * $v)) * (($v / $rho) + (2 * $this->_tanSquared($phiPrime)));
        $XII =  ($this->_secant($phiPrime) / (120.0 * pow($v, 5.0))) *
            (5.0 + (28.0 * $this->_tanSquared($phiPrime)) + (24.0 * $this->_tanSquared($phiPrime) * $this->_tanSquared($phiPrime)));
        $XIIA = ($this->_secant($phiPrime) / (5040.0 * pow($v, 7.0))) *
            (61.0 + (662.0 * $this->_tanSquared($phiPrime)) + (1320.0 * $this->_tanSquared($phiPrime) * $this->_tanSquared($phiPrime)) +
            (720.0 * $this->_tanSquared($phiPrime) * $this->_tanSquared($phiPrime) * $this->_tanSquared($phiPrime)));
        $phi = $phiPrime - ($VII * pow($easting, 2.0)) + ($VIII * pow($easting, 4.0)) - ($IX * pow($easting, 6.0));
        $lambda = $lambda0 +
            ($X * $easting) - ($XI * pow($easting, 3.0)) + ($XII * pow($easting, 5.0)) - ($XIIA * pow($easting, 7.0));

        $latLongCoordinates = new CoordinateValues(
            $phi,
            $lambda,
            \Geodetic\Angle::RADIANS,
            0.0,
            \Geodetic\Distance::METRES
        );
        return new \Geodetic\LatLong($latLongCoordinates);
    }

    function toGridRef()
    {
        $hundredkmE = floor($this->_eastings / 100000);
        $hundredkmN = floor($this->_northings / 100000);
        $firstLetter = "";
        if ($hundredkmN < 5) {
            if ($hundredkmE < 5) {
                $firstLetter = "S";
            } else {
                $firstLetter = "T";
            }
        } else if ($hundredkmN < 10) {
            if ($hundredkmE < 5) {
                $firstLetter = "N";
            } else {
                $firstLetter = "O";
            }
        } else {
            $firstLetter = "H";
        }

        $secondLetter = "";
        $index = 65 + ((4 - ($hundredkmN % 5)) * 5) + ($hundredkmE % 5);
        $ti = $index;
        if ($index >= 73)
        {
            $index++;
        }
        $secondLetter = chr($index);

        $e = round(($this->_eastings - (100000 * $hundredkmE)) / 100);
        $n = round(($this->_northings - (100000 * $hundredkmN)) / 100);

        return sprintf("%s%s%03d%03d", $firstLetter, $secondLetter, $e, $n);
    }

    public static function createOSRefFromGridRef($gridRef)
    {
        $char1 = substr($gridRef, 0, 1);
        $char2 = substr($gridRef, 1, 1);
        $east  = substr($gridRef, 2, 3) * 100;
        $north = substr($gridRef, 5, 3) * 100;
        if ($char1 == 'H') {
            $north += 1000000;
        } else if ($char1 == 'N') {
            $north += 500000;
        } else if ($char1 == 'O') {
            $north += 500000;
            $east  += 500000;
        } else if ($char1 == 'T') {
            $east += 500000;
        }
        $char2ord = ord($char2);
        if ($char2ord > 73)
        {
            $char2ord--; // Adjust for no I
        }
        $nx = (($char2ord - 65) % 5) * 100000;
        $ny = (4 - floor(($char2ord - 65) / 5)) * 100000;
        return new OSRef($north + $ny, $east + $nx);
    }
}

结合我的大地测量库

它通过整个CodePoint打开很快,为我提供了一个邮政编码细节数据库,包括用于OpenStreetMap的WGS84纬度/经度坐标。


Convert your northings/eastings to lat/long, remembering that The OS grid is based on OSGB36 rather than WGS84.

I use the following class:

<?php

namespace OSGB36;

use \Geodetic\Datum;

class Converter
{
    private $_osRef;
    private $_fromDatum;
    private $_toDatum;

    public function __construct()
    {
        $this->_osRef = new OSRef();
        $this->_fromDatum = new Datum(Datum::OSGB36);
        $this->_toDatum = new Datum(Datum::WGS84);
    }

    /**
     * Converts easting/northing into lat/long
     * 
     * @param integer $eastings
     * @param integer $northings
     * @return \Geodetic\LatLong
     */
    public function calculateLatLong($eastings, $northings)
    {
        $this->_osRef->setNorthings($northings)
                     ->setEastings($eastings);
        $OSGB36LatLong = $this->_osRef->toLatLong(
            $this->_fromDatum->getReferenceEllipsoid()
        );

        $ecef = $OSGB36LatLong->toECEF($this->_fromDatum);
        $ecef->toWGS84($this->_fromDatum);
        $WGS84LatLong = $ecef->toLatLong($this->_toDatum);

        return $WGS84LatLong;
    }
}

and

<?php

namespace OSGB36;

use \Geodetic\LatLong\CoordinateValues;

class OSRef
{
    private $_northings;
    private $_eastings;

    public function __construct($northings = NULL, $eastings = NULL)
    {
        $this->_northings = $northings;
        $this->_eastings  = $eastings;
    }

    public function setNorthings($northings)
    {
        $this->_northings = $northings;

        return $this;
    }

    public function setEastings($eastings)
    {
        $this->_eastings = $eastings;

        return $this;
    }


    private function _sinSquared($x) {
        return sin($x) * sin($x);
    }

    private function _tanSquared($x) {
        return tan($x) * tan($x);
    }

    private function _secant($x) {
        return 1.0 / cos($x);
    }

    private function _cosecant($x) {
        return 1.0 / sin($x);
    }

    private function _cotangent($x) {
        return 1.0 / tan($x);
    }

    public function toLatLong(\Geodetic\ReferenceEllipsoid $airy1830) {
        $OSGB_F0       = 0.9996012717;    //  Central Meridan Scale factor
        $N0            = -100000.0;       //  True origin Northing
        $E0            = 400000.0;        //  True origin Easting
        $phi0          = deg2rad(49.0);   //  True origin Latitude
        $lambda0       = deg2rad(-2.0);   //  True origin Longitude
        $semiMajorAxis = $airy1830->getSemiMajorAxis();
        $semiMinorAxis = $airy1830->getSemiMinorAxis();
        $eSquared      = $airy1830->getFirstEccentricitySquared();
        $easting       = $this->_eastings - $E0;
        $northing      = $this->_northings - $N0;
        $n             = ($semiMajorAxis - $semiMinorAxis) / ($semiMajorAxis + $semiMinorAxis);
        $M             = 0.0;
        $phiPrime      = ($northing / ($semiMajorAxis * $OSGB_F0)) + $phi0;

        do {
            $M = ($semiMinorAxis * $OSGB_F0) *
                (((1 + $n + ((5.0 / 4.0) * $n * $n) + ((5.0 / 4.0) * $n * $n * $n)) *
                ($phiPrime - $phi0)) -
                (((3 * $n) + (3 * $n * $n) + ((21.0 / 8.0) * $n * $n * $n)) *
                sin($phiPrime - $phi0) *
                cos($phiPrime + $phi0)) +
                ((((15.0 / 8.0) * $n * $n) + ((15.0 / 8.0) * $n * $n * $n)) *
                sin(2.0 * ($phiPrime - $phi0)) *
                cos(2.0 * ($phiPrime + $phi0))) -
                (((35.0 / 24.0) * $n * $n * $n) *
                sin(3.0 * ($phiPrime - $phi0)) *
                cos(3.0 * ($phiPrime + $phi0))));
            $phiPrime += ($northing - $M) / ($semiMajorAxis * $OSGB_F0);
        } while (($northing - $M) >= 0.001);

        $v = $semiMajorAxis * $OSGB_F0 * pow(1.0 - $eSquared * $this->_sinSquared($phiPrime), -0.5);
        $rho = $semiMajorAxis * $OSGB_F0 * (1.0 - $eSquared) *
            pow(1.0 - $eSquared * $this->_sinSquared($phiPrime), -1.5);
        $etaSquared = ($v / $rho) - 1.0;
        $VII = tan($phiPrime) / (2 * $rho * $v);
        $VIII = (tan($phiPrime) / (24.0 * $rho * pow($v, 3.0))) *
            (5.0 + (3.0 * $this->_tanSquared($phiPrime)) + $etaSquared - (9.0 * $this->_tanSquared($phiPrime) * $etaSquared));
        $IX = (tan($phiPrime) / (720.0 * $rho * pow($v, 5.0))) *
            (61.0 + (90.0 * $this->_tanSquared($phiPrime)) + (45.0 * $this->_tanSquared($phiPrime) * $this->_tanSquared($phiPrime)));
        $X = $this->_secant($phiPrime) / $v;
        $XI = ($this->_secant($phiPrime) / (6.0 * $v * $v * $v)) * (($v / $rho) + (2 * $this->_tanSquared($phiPrime)));
        $XII =  ($this->_secant($phiPrime) / (120.0 * pow($v, 5.0))) *
            (5.0 + (28.0 * $this->_tanSquared($phiPrime)) + (24.0 * $this->_tanSquared($phiPrime) * $this->_tanSquared($phiPrime)));
        $XIIA = ($this->_secant($phiPrime) / (5040.0 * pow($v, 7.0))) *
            (61.0 + (662.0 * $this->_tanSquared($phiPrime)) + (1320.0 * $this->_tanSquared($phiPrime) * $this->_tanSquared($phiPrime)) +
            (720.0 * $this->_tanSquared($phiPrime) * $this->_tanSquared($phiPrime) * $this->_tanSquared($phiPrime)));
        $phi = $phiPrime - ($VII * pow($easting, 2.0)) + ($VIII * pow($easting, 4.0)) - ($IX * pow($easting, 6.0));
        $lambda = $lambda0 +
            ($X * $easting) - ($XI * pow($easting, 3.0)) + ($XII * pow($easting, 5.0)) - ($XIIA * pow($easting, 7.0));

        $latLongCoordinates = new CoordinateValues(
            $phi,
            $lambda,
            \Geodetic\Angle::RADIANS,
            0.0,
            \Geodetic\Distance::METRES
        );
        return new \Geodetic\LatLong($latLongCoordinates);
    }

    function toGridRef()
    {
        $hundredkmE = floor($this->_eastings / 100000);
        $hundredkmN = floor($this->_northings / 100000);
        $firstLetter = "";
        if ($hundredkmN < 5) {
            if ($hundredkmE < 5) {
                $firstLetter = "S";
            } else {
                $firstLetter = "T";
            }
        } else if ($hundredkmN < 10) {
            if ($hundredkmE < 5) {
                $firstLetter = "N";
            } else {
                $firstLetter = "O";
            }
        } else {
            $firstLetter = "H";
        }

        $secondLetter = "";
        $index = 65 + ((4 - ($hundredkmN % 5)) * 5) + ($hundredkmE % 5);
        $ti = $index;
        if ($index >= 73)
        {
            $index++;
        }
        $secondLetter = chr($index);

        $e = round(($this->_eastings - (100000 * $hundredkmE)) / 100);
        $n = round(($this->_northings - (100000 * $hundredkmN)) / 100);

        return sprintf("%s%s%03d%03d", $firstLetter, $secondLetter, $e, $n);
    }

    public static function createOSRefFromGridRef($gridRef)
    {
        $char1 = substr($gridRef, 0, 1);
        $char2 = substr($gridRef, 1, 1);
        $east  = substr($gridRef, 2, 3) * 100;
        $north = substr($gridRef, 5, 3) * 100;
        if ($char1 == 'H') {
            $north += 1000000;
        } else if ($char1 == 'N') {
            $north += 500000;
        } else if ($char1 == 'O') {
            $north += 500000;
            $east  += 500000;
        } else if ($char1 == 'T') {
            $east += 500000;
        }
        $char2ord = ord($char2);
        if ($char2ord > 73)
        {
            $char2ord--; // Adjust for no I
        }
        $nx = (($char2ord - 65) % 5) * 100000;
        $ny = (4 - floor(($char2ord - 65) / 5)) * 100000;
        return new OSRef($north + $ny, $east + $nx);
    }
}

combined with my Geodetic library.

It's pretty quick chundering through the entirety of CodePoint open to give me a database of postcode details including WGS84 lat/long coordinates for use with OpenStreetMap.

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)