logo
down
shadow

Android - twitter4j Proguard error


Android - twitter4j Proguard error

By : john
Date : November 22 2020, 10:48 AM
hope this fix your issue Looks like there were a number of issues. Got it sorted in the end. In case it helps anyone else, here is my full proguard-project.txt file:
code :
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

#
# My classes - start
#

-keep public class com.example.SplashActivity
-keep public class com.example.FragmentActivityWithListener
-keep public class com.example.AbstractHelpActivity
-keep public class com.example.GetContentFromWebTask$CompletedListener

#
# My classes - end
#


#
# Twitter library - start
#

-dontwarn twitter4j.**
-keep class twitter4j.** { *; }

#
# Twitter library - end
#



#
# Google Play Service library - start
#

-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

#
# Google Play Service library - end
#



#
# Ads - start
#

-keep public class com.google.android.gms.ads.** {
   public *;
}

-keep public class com.google.ads.** {
   public *;
}

#
# Ads - end
#


#
# ACRA - start
#

#ACRA specifics
# Restore some Source file names and restore approximate line numbers in the stack traces,
# otherwise the stack traces are pretty useless
-keepattributes SourceFile,LineNumberTable

# ACRA needs "annotations" so add this...
# Note: This may already be defined in the default "proguard-android-optimize.txt"
# file in the SDK. If it is, then you don't need to duplicate it. See your
# "project.properties" file to get the path to the default "proguard-android-optimize.txt".
-keepattributes *Annotation*

# keep this class so that logging will show 'ACRA' and not a obfuscated name like 'a'.
# Note: if you are removing log messages elsewhere in this file then this isn't necessary
-keep class org.acra.ACRA {
    *;
}

# keep this around for some enums that ACRA needs
-keep class org.acra.ReportingInteractionMode {
    *;
}

-keepnames class org.acra.sender.HttpSender$** {
    *;
}

-keepnames class org.acra.ReportField {
    *;
}

# keep this otherwise it is removed by ProGuard
-keep public class org.acra.ErrorReporter {
    public void addCustomData(java.lang.String,java.lang.String);
    public void putCustomData(java.lang.String,java.lang.String);
    public void removeCustomData(java.lang.String);
}

# keep this otherwise it is removed by ProGuard
-keep public class org.acra.ErrorReporter {
    public void handleSilentException(java.lang.Throwable);
}

#
# ACRA - end
#


#
# Facebook - start
#
-keep class com.facebook.** { *; }
-keepattributes Signature
#
# Facebook - end
#


Share : facebook icon twitter icon
Android Twitter4j giving error NoClassDefFoundError: twitter4j.TwitterFactory

Android Twitter4j giving error NoClassDefFoundError: twitter4j.TwitterFactory


By : Luis Alves
Date : March 29 2020, 07:55 AM
should help you out I've found the solution now. The problem was that I was using a very old version of Twitter4j, and in my libs folder, there were multiple jars with identical names. I have now fixed those problems and it is now working perfectly.
Android Twitter4j giving error NoClassDefFoundError: twitter4j.http.AccessToken

Android Twitter4j giving error NoClassDefFoundError: twitter4j.http.AccessToken


By : CMOSversion
Date : March 29 2020, 07:55 AM
may help you . see my post- No class defination found error even if there is no issues & let me know if this not working in your side.
proguard + maven + android Error: Method must be overridden in [proguard.optimize.peephole.ClassMerger] if ever called

proguard + maven + android Error: Method must be overridden in [proguard.optimize.peephole.ClassMerger] if ever called


By : YJM
Date : March 29 2020, 07:55 AM
like below fixes the issue Problem is solved. Before start to explain how did I solve the problem I'm going to mention how it was working with ANT without problem but wasn't through maven. It was running with ANT because ANT was looking for project.properties file and its configuration was like below
code :
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
Android and Proguard with jackrabbit-webdav: Proguard returned with error code 1. See console

Android and Proguard with jackrabbit-webdav: Proguard returned with error code 1. See console


By : daz
Date : March 29 2020, 07:55 AM
hope this fix your issue ProGuard indeed needs all dependencies for its static analysis. However, the missing classes presumably are never used, so you can tell ProGuard to ignore them:
android Proguard obfuscation with twitter4j

android Proguard obfuscation with twitter4j


By : Sarah Henry
Date : March 29 2020, 07:55 AM
seems to work fine I am trying to use proguard with twitter4j and constantly recieving a noMethodFound exception when calling new TwitterFactory(configuration) . This is the exception: , My proguard configuration for Twitter 4j is as follows:-
Related Posts Related Posts :
  • How to write generic Java API without method Overloading
  • Java Serialization / Deserialization of an ArrayList works only on first program execution
  • Conway's Game of Life's rules dont apply properly
  • call a java method when Click on a html button without using javascript
  • Why does SSLSocketFactory.createSocket returns a Socket instead of SSLSocket?
  • How to schedule a task in Tomcat
  • compare two pdf files (approach) using java
  • What is the use of allowCoreThreadTimeout( ) in ThreadPoolExecutor?
  • Describe the Strategy Design Pattern in Java?
  • MongoDB too many open connections
  • Issue with generate JAXB classes with value constructors
  • Moving from one frame to another in java swing
  • Get a thread by Id
  • how to open front camera and back camera at same time?
  • Messed up with Java Declaration
  • Extracting chart in EXcel as image using java
  • How to get latitude and longitude in Android phone?
  • Do GC pauses and kill -STOP produce the same behavior?
  • Android HTML.ImageGetter Images resized
  • The way to instantiate map<String, List<String>> in Java
  • Java Making objects move while buttons held
  • Androidx Navigation View - `setNavigationItemSelectedListener` Doesn't Work
  • after compiling code JFrame does not appear
  • Netbeans project, JFrames ran from the main JFrame close all JFrames in project
  • Square Retrofit Client: How to enable/disable followRedirects? How to intercept redirect URL?
  • Java Circular Reference - Can’t Compile
  • Mouse click on specific time JAVA
  • android 4 onCreateDialog return type incompatible when overriding
  • Java Implementation of Oracle's DBMS_UTILITY.GET_HASH_VALUE Function
  • javac cannot be run, and furthermore does not seem installed
  • Function to obtain a thread given its ID
  • Java File path to Executable has spaces
  • Minimum Oracle Java VM heap memory setting?
  • Elegant way to create one of a large number of classes
  • Java fx binding styles
  • Summing weights based on string in large file
  • Android ListView setOnItemClickListener not working
  • How is the Java Bootstrap Classloader loaded?
  • Check object is blank
  • Add image between text in JEditorPane
  • Java POI Excel creating new column and new rows
  • NullPointerException when managing bean with Spring+JSF(Primefaces)
  • Content autocomplete in spring tool suite 4
  • Super Noob Help ~ MouseEvent/Frame
  • Making one project with dependencies stand-alone in Eclipse (Java)
  • Jsoup- getting certain attributes from website
  • MongoDB, how to make a link between collections with JAVA code
  • Overriding an abstract method means class abstract class or not in java?
  • Bukkit teleport - nullPointerException
  • How to check if a Float variable is negative in java
  • Servlet: Cannot forward after response has been committed
  • sql query to select a specific cell in excel
  • How to make new picture when mouse dragged in java
  • Use Constants interface in GWT Project
  • Setting size of a JPanel in GroupLayout
  • Construct a map from two equal size arrays
  • Implementing Read-Write Locks with Double-Checked Locking
  • Disable NO_BUTTON from JOptionPane Java if a condition is true
  • UDP multiple socket
  • Android Threading: This Handler class should be static or leaks might occur
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org